[Libreoffice-commits] online.git: loolwsd/DocumentBroker.cpp
Ashod Nakashian
ashod.nakashian at collabora.co.uk
Sun Apr 10 17:19:07 UTC 2016
loolwsd/DocumentBroker.cpp | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit 85641d934e27eab4206f6e6c81646ea142539284
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date: Sun Apr 10 13:06:35 2016 -0400
loolwsd: for consistency always remove edit lock before taking it
Change-Id: Id24d6737fc3af77097058b28a77d6ca2d757cb9e
Reviewed-on: https://gerrit.libreoffice.org/23965
Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/loolwsd/DocumentBroker.cpp b/loolwsd/DocumentBroker.cpp
index 4551270..4b25e48 100644
--- a/loolwsd/DocumentBroker.cpp
+++ b/loolwsd/DocumentBroker.cpp
@@ -239,17 +239,18 @@ void DocumentBroker::addWSSession(const std::string id, std::shared_ptr<MasterPr
void DocumentBroker::removeWSSession(const std::string id)
{
std::lock_guard<std::mutex> sessionsLock(_wsSessionsMutex);
- bool bEditLock = false;
+
+ bool haveEditLock = false;
auto it = _wsSessions.find(id);
if (it != _wsSessions.end())
{
- if (it->second->isEditLocked())
- bEditLock = true;
-
+ haveEditLock = it->second->isEditLocked();
+ it->second->setEditLock(false);
+ it->second->sendTextFrame("editlock 0");
_wsSessions.erase(it);
}
- if (bEditLock)
+ if (haveEditLock)
{
// pass the edit lock to first session in map
it = _wsSessions.begin();
More information about the Libreoffice-commits
mailing list