[Libreoffice-commits] online.git: kit/Kit.cpp
Ashod Nakashian (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 12 12:21:05 UTC 2020
kit/Kit.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit a86508d815013c40e3ae8c494b883e112a7195f2
Author: Ashod Nakashian <ashod.nakashian at collabora.co.uk>
AuthorDate: Sun Mar 8 14:27:02 2020 -0400
Commit: Ashod Nakashian <ashnakash at gmail.com>
CommitDate: Thu Mar 12 13:20:47 2020 +0100
wsd: kit now exits immediately when wsd send exit
The 'exit' command from DocBroker to Kit is processed
immediately. It set the termination flag and destroyed
the Document instance in Kit. Unfortunately, this is
highly problematic. There are a number of races here.
Normal disconnection procedure from DocBroker is to
first send 'disconnect'. This tells Kit to unload
and close the view in question, and when 0 views
are left, it simply exits the process.
However, since 'disconnect' is processed in the
message queue, the 'exit' (and indeed the socket
disconnection that follows 'exit') may be handled
before the message queue is drained, and so the
'disconnect' wouldn't have been processed yet.
The end result of these two races is that Kit
tries to exit the Core main loop, which fails
a number of assertion (f.e. that no LOK Windows
remain, which is presumably a leak check, which
we care not about as we don't attempt to cleanup
the sidebar).
The fix here is to process 'exit' immediately,
because DocBroker is gone, there is absolutely
nothing for Kit to do anymore.
Change-Id: I5c09fcfdb1713f4e0b56b717c747d919d0c6728f
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90356
Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
Tested-by: Ashod Nakashian <ashnakash at gmail.com>
diff --git a/kit/Kit.cpp b/kit/Kit.cpp
index 54ad81647..496514e46 100644
--- a/kit/Kit.cpp
+++ b/kit/Kit.cpp
@@ -2151,9 +2151,9 @@ protected:
}
else if (tokens.equals(0, "exit"))
{
- LOG_INF("Setting TerminationFlag due to 'exit' command from parent.");
- SigUtil::setTerminationFlag();
- document.reset();
+ LOG_INF("Terminating immediately due to parent 'exit' command.");
+ Log::shutdown();
+ std::_Exit(EX_SOFTWARE);
}
else if (tokens.equals(0, "tile") || tokens.equals(0, "tilecombine") || tokens.equals(0, "canceltiles") ||
tokens.equals(0, "paintwindow") || tokens.equals(0, "resizewindow") ||
More information about the Libreoffice-commits
mailing list