summaryrefslogtreecommitdiff
path: root/src/manager-lib/applicationmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/manager-lib/applicationmanager.cpp')
-rw-r--r--src/manager-lib/applicationmanager.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/manager-lib/applicationmanager.cpp b/src/manager-lib/applicationmanager.cpp
index 5305ebef..9b27c8e1 100644
--- a/src/manager-lib/applicationmanager.cpp
+++ b/src/manager-lib/applicationmanager.cpp
@@ -685,6 +685,8 @@ bool ApplicationManager::startApplicationInternal(const QString &appId, const QS
return false;
case Am::NotRunning:
+ throw Exception("Application %1 is not running, but still has a Runtime object attached")
+ .arg(app->id());
break;
}
}
@@ -806,12 +808,14 @@ bool ApplicationManager::startApplicationInternal(const QString &appId, const QS
qCDebug(LogSystem) << " documentUrl:" << documentUrl;
if (inProcess) {
- bool ok = runtime->start();
- if (ok)
+ bool successfullyStarted = runtime->start();
+
+ if (successfullyStarted)
emitActivated(app);
else
- runtime->deleteLater();
- return ok;
+ delete runtime;
+
+ return successfullyStarted;
} else {
// We can only start the app when both the container and the windowmanager are ready.
// Using a state-machine would be one option, but then we would need that state-machine
@@ -823,7 +827,7 @@ bool ApplicationManager::startApplicationInternal(const QString &appId, const QS
if (successfullyStarted)
emitActivated(app);
else
- runtime->deleteLater(); // ~Runtime() will clean app->nonAliased()->m_runtime
+ delete runtime; // ~Runtime() will clean up app->m_runtime
return successfullyStarted;
};