summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2018-12-04 14:42:31 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2018-12-10 10:25:15 +0100
commiteb469025573c2d74fe4b1089345a1f5dff930107 (patch)
tree581f394ebd97213c576eae2ff8b64b73985b03c7
parent7c761ae3d363d6763dc182dd4481a9780521d9ed (diff)
tdf#121399 Join cmd reading thread in gtk3_kde5
Stop reading commands from the pipe on kde5 side once the "Quit" command has been sent, in order to have the thread that is reading commands from stdin finish properly. Join the thread in the 'FilePickerIpc' destructor, rather than just deleting it while it may still be running, which resulted in 'terminate()' being called. Change-Id: Ia184987e7994cc1de0208ff2757a3cf06c8b7194 Reviewed-on: https://gerrit.libreoffice.org/63835 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> (cherry picked from commit 93815c2b04f1905e43c695caf5cc2c594bb897ce) Reviewed-on: https://gerrit.libreoffice.org/64588 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit 626ebc8d81d684d3a845ff787fbaaf416df7e427) Reviewed-on: https://gerrit.libreoffice.org/64813 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx b/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx
index 803e5bedd853..4d7aff80c27c 100644
--- a/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx
+++ b/vcl/unx/gtk3_kde5/kde5_filepicker_ipc.cxx
@@ -192,6 +192,12 @@ void readCommands(FilePickerIpc* ipc)
readCommandArgs(command, args);
emit ipc->commandReceived(messageId, command, args);
+
+ // stop processing once 'Quit' command has been sent
+ if (command == Commands::Quit)
+ {
+ return;
+ }
}
}
@@ -211,7 +217,11 @@ FilePickerIpc::FilePickerIpc(KDE5FilePicker* filePicker, QObject* parent)
m_ipcReaderThread = std::unique_ptr<std::thread>{ new std::thread(readCommands, this) };
}
-FilePickerIpc::~FilePickerIpc() = default;
+FilePickerIpc::~FilePickerIpc()
+{
+ // join thread that reads commands
+ m_ipcReaderThread->join();
+};
bool FilePickerIpc::handleCommand(uint64_t messageId, Commands command, QList<QVariant> args)
{