wsd/DocumentBroker.cpp |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 560406a3081cfc5b48f4d6900b1f3c702261f81f
Author: Ashod Nakashian <ashod.nakash...@collabora.co.uk>
Date:   Thu Apr 20 22:43:27 2017 -0400

    wsd: don't remove session after saving unconditionally
    
    We should only remove sessions that had already been
    disconnected, which caused the saving.
    
    Change-Id: I22fc54356af50df7a7bd2107fa17f6951d40812f
    Reviewed-on: https://gerrit.libreoffice.org/36762
    Reviewed-by: Ashod Nakashian <ashnak...@gmail.com>
    Tested-by: Ashod Nakashian <ashnak...@gmail.com>

diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp
index a2b90d50..9cd27989 100644
--- a/wsd/DocumentBroker.cpp
+++ b/wsd/DocumentBroker.cpp
@@ -562,11 +562,12 @@ bool DocumentBroker::saveToStorage(const std::string& 
sessionId,
 
     const bool res = saveToStorageInternal(sessionId, success, result);
 
-    // We've saved and can safely destroy this session.
-    removeSessionInternal(sessionId);
+    // If marked to destroy, or session is disconnected, remove.
+    const auto it = _sessions.find(sessionId);
+    if (_markToDestroy || (it != _sessions.end() && 
it->second->isCloseFrame()))
+        removeSessionInternal(sessionId);
 
     // If marked to destroy, then this was the last session.
-    // Otherwise, check that we are (which we might be by now).
     if (_markToDestroy || _sessions.empty())
     {
         // Stop so we get cleaned up and removed.
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to