Kaydet (Commit) 93815c2b authored tarafından Michael Weghorn's avatar Michael Weghorn

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: 's avatarMichael Weghorn <m.weghorn@posteo.de>
üst 8dbe0af7
......@@ -192,6 +192,12 @@ static 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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment