[Libreoffice-commits] online.git: loolwsd/LOOLKit.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Tue Sep 20 11:58:37 UTC 2016


 loolwsd/LOOLKit.cpp |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3b2055a0a880e79f9a4c3dec0fa2c91cbc9c07ce
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Tue Sep 20 07:56:06 2016 -0400

    loolwsd: remove the callback descriptor after destroyView
    
    On destroyView Core must flush the events queue, otherwise
    by the next idle the descriptor will be gone and we'll
    be using freed memory.
    
    Change-Id: I6d3d8f9461bc156383a7294e9c65c535d79f2e7a
    Reviewed-on: https://gerrit.libreoffice.org/29088
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 4f1f448..a04945c 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -1002,8 +1002,8 @@ private:
         const auto viewId = session.getViewId();
         _loKitDocument->setView(viewId);
         _loKitDocument->registerCallback(nullptr, nullptr);
-        _viewIdToCallbackDescr.erase(viewId);
         _loKitDocument->destroyView(viewId);
+        _viewIdToCallbackDescr.erase(viewId);
         Log::debug("Destroyed view " + std::to_string(viewId));
     }
 


More information about the Libreoffice-commits mailing list