From 9b45e25f817202edfc9f7f25f7ee95a4024c697b Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Mon, 3 Jun 2019 14:46:18 +0200 Subject: [PATCH] manually quit kauth's mainloop Summary: kauth helpers have a qcoreapplication started which auto-terminates after 10 seconds of idle time. this would be an added time out on top of our life time management that is not necessary. to prevent this additional delay simply quit the qapplication directly. this makes helper termination almost instantaneous even when the dbus client disappears due to crash or SIGINT, and largely removes the need to call stopHelper altogether. BUG: 408245 Test Plan: both partitionmanager and calamares instantly quit the helper no matter how the client process gets terminated other than that everything seems to work as before Reviewers: stikonas Differential Revision: https://phabricator.kde.org/D21559 --- src/util/externalcommandhelper.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/externalcommandhelper.cpp b/src/util/externalcommandhelper.cpp index 5be2ec7..feabfe8 100644 --- a/src/util/externalcommandhelper.cpp +++ b/src/util/externalcommandhelper.cpp @@ -20,6 +20,7 @@ #include "externalcommand_whitelist.h" #include +#include #include #include #include @@ -82,6 +83,11 @@ ActionReply ExternalCommandHelper::init(const QVariantMap& args) m_loop->exec(); reply.addData(QStringLiteral("success"), true); + // Also end the application loop started by KAuth's main() code. Our loop + // exits when our client disappears. Without client we have no reason to + // live. + qApp->quit(); + return reply; }