[Libreoffice-commits] online.git: wsd/LOOLWSD.cpp

Ashod Nakashian ashod.nakashian at collabora.co.uk
Mon Jan 2 06:03:11 UTC 2017


 wsd/LOOLWSD.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 15a6c02f707fa8596922f280a4aa21156765717b
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
Date:   Fri Dec 30 17:19:53 2016 -0500

    wsd: remove DocumentBroker instances without sessions
    
    Change-Id: I052acba594f0da76332996b25c5349e8fff23606
    Reviewed-on: https://gerrit.libreoffice.org/32613
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp
index faa5a7f..6161eb7 100644
--- a/wsd/LOOLWSD.cpp
+++ b/wsd/LOOLWSD.cpp
@@ -269,11 +269,16 @@ bool cleanupDocBrokers()
     const auto count = DocBrokers.size();
     for (auto it = DocBrokers.begin(); it != DocBrokers.end(); )
     {
+        auto docBroker = it->second;
+        auto lock = docBroker->getLock();
+
         // Cleanup used and dead entries.
-        if (it->second->isLoaded() && !it->second->isAlive())
+        if (docBroker->isLoaded() &&
+            (docBroker->getSessionsCount() == 0 || !docBroker->isAlive()))
         {
-            LOG_DBG("Removing dead DocBroker [" << it->first << "].");
+            LOG_DBG("Removing dead DocumentBroker for docKey [" << it->first << "].");
             it = DocBrokers.erase(it);
+            docBroker->terminateChild(lock);
         }
         else
         {


More information about the Libreoffice-commits mailing list