[Libreoffice-commits] online.git: loolwsd/ChildProcessSession.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Sat Apr 30 14:38:57 UTC 2016
loolwsd/ChildProcessSession.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
New commits:
commit 8e31a512b13ebcf2959926fe3d02986775fb199e
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sat Apr 30 10:27:49 2016 -0400
loolwsd: fix a race between loading and setting part
Change-Id: Ib9a5b3dfe82ff5915208c420b8dc8124d08c5533
Reviewed-on: https://gerrit.libreoffice.org/24529
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index bb11a1a..a912798 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -114,7 +114,12 @@ public:
{
case LOK_CALLBACK_INVALIDATE_TILES:
{
- int curPart = _session.getLoKitDocument()->pClass->getPart(_session.getLoKitDocument());
+ const auto lokitDoc = _session.getLoKitDocument();
+ assert(lokitDoc);
+ assert(lokitDoc->pClass);
+ assert(lokitDoc->pClass->getPart);
+
+ int curPart = lokitDoc->pClass->getPart(lokitDoc);
_session.sendTextFrame("curpart: part=" + std::to_string(curPart));
if (_session.getDocType() == "text")
{
@@ -575,6 +580,8 @@ bool ChildProcessSession::loadDocument(const char * /*buffer*/, int /*length*/,
assert(!_docURL.empty());
assert(!_jailedFilePath.empty());
+ std::unique_lock<std::recursive_mutex> lock(Mutex);
+
_loKitDocument = _onLoad(getId(), _jailedFilePath, _docPassword, renderOpts, _haveDocPassword);
if (!_loKitDocument)
{
@@ -582,8 +589,6 @@ bool ChildProcessSession::loadDocument(const char * /*buffer*/, int /*length*/,
return false;
}
- std::unique_lock<std::recursive_mutex> lock(Mutex);
-
if (_multiView)
{
_viewId = _loKitDocument->pClass->getView(_loKitDocument);
More information about the Libreoffice-commits
mailing list