From b251c98a4e902cde25593796711cf7010eb27f86 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Mon, 16 Mar 2026 11:42:59 +0000 Subject: [PATCH] fix: kill core orphan on gui death (linux) --- src/lib/gui/core/CoreProcess.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/lib/gui/core/CoreProcess.cpp b/src/lib/gui/core/CoreProcess.cpp index a52127573..1e7a7a2ad 100644 --- a/src/lib/gui/core/CoreProcess.cpp +++ b/src/lib/gui/core/CoreProcess.cpp @@ -14,6 +14,11 @@ #include "OSXHelpers.h" #endif +#ifdef Q_OS_LINUX +#include +#include +#endif + #include #include #include @@ -203,6 +208,14 @@ void CoreProcess::startForegroundProcess(const QStringList &args) const auto quoted = makeQuotedArgs(m_appPath, args); qInfo("running command: %s", qPrintable(quoted)); +#ifdef Q_OS_LINUX + m_process->setChildProcessModifier([] { + // the core process becomes orphaned when the gui process exits abruptly (e.g. with kill -9), + // so ensure the os also kills the core when that happens to the gui. + prctl(PR_SET_PDEATHSIG, SIGTERM); + }); +#endif + m_process->start(m_appPath, args); if (m_process->waitForStarted()) {