wsd/DocumentBroker.cpp | 6 ++---- wsd/LOOLWSD.cpp | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
New commits: commit 14fe58adb48865be947c78c04df4b3c4a163f08e Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Mon Sep 30 23:59:53 2019 +0300 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Tue Oct 1 09:50:51 2019 +0200 tdf#125575: Don't be so eager to clean up too early in the MOBILEAPP case It's not needed in an app, and causes misbehaviour when the lifecycle of DocumentBroker objects gets screwed up. Many of the desperate attempts to "clean up" here and there in the code are likely relevant only in web-based Online to catch weird error situations. In an app our objects hopefully have a much simpler lifecycle. Change-Id: I788171cd1ca114ecaca276a7f24185ff67b984c7 Reviewed-on: https://gerrit.libreoffice.org/79902 Reviewed-by: Tor Lillqvist <t...@collabora.com> Tested-by: Tor Lillqvist <t...@collabora.com> diff --git a/wsd/DocumentBroker.cpp b/wsd/DocumentBroker.cpp index 1b09c2f07..8b0011fcd 100644 --- a/wsd/DocumentBroker.cpp +++ b/wsd/DocumentBroker.cpp @@ -340,11 +340,9 @@ void DocumentBroker::pollThread() last30SecCheckTime = std::chrono::steady_clock::now(); } - if (false) - ; #if !MOBILEAPP // Remove idle documents after 1 hour. - else if ((isLoaded() && getIdleTimeSecs() >= IdleDocTimeoutSecs)) + if ((isLoaded() && getIdleTimeSecs() >= IdleDocTimeoutSecs)) { // Stop if there is nothing to save. LOG_INF("Autosaving idle DocumentBroker for docKey [" << getDocKey() << "] to kill."); @@ -354,13 +352,13 @@ void DocumentBroker::pollThread() stop("idle"); } } -#endif else if (_sessions.empty() && (isLoaded() || _markToDestroy)) { // If all sessions have been removed, no reason to linger. LOG_INF("Terminating dead DocumentBroker for docKey [" << getDocKey() << "]."); stop("dead"); } +#endif } LOG_INF("Finished polling doc [" << _docKey << "]. stop: " << _stop << ", continuePolling: " << diff --git a/wsd/LOOLWSD.cpp b/wsd/LOOLWSD.cpp index 14eabf0ac..2c47170c4 100644 --- a/wsd/LOOLWSD.cpp +++ b/wsd/LOOLWSD.cpp @@ -1567,10 +1567,10 @@ void PrisonerPoll::wakeupHook() #endif } } -#endif std::unique_lock<std::mutex> docBrokersLock(DocBrokersMutex, std::defer_lock); if (docBrokersLock.try_lock()) cleanupDocBrokers(); +#endif } #if !MOBILEAPP _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits