[Libreoffice-commits] online.git: wsd/DocumentBroker.cpp
Michael Meeks (via logerrit)
logerrit at kemper.freedesktop.org
Wed Nov 6 00:34:27 UTC 2019
wsd/DocumentBroker.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit a8924e6e6f0cfa88b2ef96a73f0de2686c26508e
Author: Michael Meeks <michael.meeks at collabora.com>
AuthorDate: Wed Nov 6 00:33:37 2019 +0000
Commit: Michael Meeks <michael.meeks at collabora.com>
CommitDate: Wed Nov 6 00:33:37 2019 +0000
avoid crash prior to load when _tileCache is not yet created.
Change-Id: Ic8b3b25af23df7638f0ccf48740f2267612e4e8b
diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index 754844e89..5a0926a2d 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -291,7 +291,8 @@ void DocumentBroker::pollThread()
#if !MOBILEAPP
// a tile's data is ~8k, a 4k screen is ~128 256x256 tiles
- _tileCache->setMaxCacheSize(8 * 1024 * 128 * _sessions.size());
+ if (_tileCache)
+ _tileCache->setMaxCacheSize(8 * 1024 * 128 * _sessions.size());
if (!_isLoaded && (limit_load_secs > 0) && (now > loadDeadline))
{
@@ -1474,7 +1475,8 @@ bool DocumentBroker::handleInput(const std::vector<char>& payload)
size_t DocumentBroker::getMemorySize() const
{
- return sizeof(DocumentBroker) + _tileCache->getMemorySize() +
+ return sizeof(DocumentBroker) +
+ (!!_tileCache ? _tileCache->getMemorySize() : 0) +
_sessions.size() * sizeof(ClientSession);
}
@@ -2171,7 +2173,8 @@ void DocumentBroker::dumpState(std::ostream& os)
os << "\n last saved: " << std::ctime(&t);
os << "\n cursor " << _cursorPosX << ", " << _cursorPosY
<< "( " << _cursorWidth << "," << _cursorHeight << ")\n";
- _tileCache->dumpState(os);
+ if (_tileCache)
+ _tileCache->dumpState(os);
_poll->dumpState(os);
}
More information about the Libreoffice-commits
mailing list