From c8a46e78a8615caeffb541fe9b98b617b5e5538b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 13 Apr 2016 12:17:59 +0300 Subject: [PATCH] bccu#1678: Check whether document can be discarded also in stop predicate Seems to fix the problem that the loolkit processes hang around forever even if there is no associated client. --- loolwsd/LOOLKit.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp index 12e652e96..68fe829d8 100644 --- a/loolwsd/LOOLKit.cpp +++ b/loolwsd/LOOLKit.cpp @@ -1064,7 +1064,12 @@ void lokit_main(const std::string& childRoot, return true; }, - [](){ return TerminationFlag; }); + [&document]() + { + if (document && document->canDiscard()) + TerminationFlag = true; + return TerminationFlag; + }); // Cleanup jail. Util::removeFile(jailPath, true);