components/mobileshell: Ensure app pids are cleared

This commit is contained in:
Devin Lin 2022-10-12 19:30:18 -04:00
parent f3a4913147
commit 10dcf8b17a

View file

@ -110,7 +110,8 @@ bool ShellUtil::isLaunchingApp()
void ShellUtil::setLaunchingApp(KIO::ApplicationLauncherJob *launcherJob) void ShellUtil::setLaunchingApp(KIO::ApplicationLauncherJob *launcherJob)
{ {
m_launchingApp = launcherJob; m_launchingAppPids = {};
m_launchingApp = launcherJob; // do not assume that the pointer is valid, KJobs destroy themselves
connect(launcherJob, &KIO::ApplicationLauncherJob::result, this, [this](auto *job) { connect(launcherJob, &KIO::ApplicationLauncherJob::result, this, [this](auto *job) {
m_launchingAppPids = m_launchingApp->pids(); m_launchingAppPids = m_launchingApp->pids();
}); });