diff options
author | Oliver Wolff <oliver.wolff@nokia.com> | 2011-11-15 08:44:28 +0100 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@nokia.com> | 2011-11-17 11:07:26 +0100 |
commit | d3b3f88435c939ea5f6abe0cf5d29a25fb4cbed9 (patch) | |
tree | 0511baae16c83f5c0d7993695a70d78356c20a4e | |
parent | b066d8ef6cacfaee746d90efd7ed2257f77c100c (diff) |
Kill previous instance of application when a new one connects to the Simulator
-rw-r--r-- | src/other/applicationmanager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/other/applicationmanager.cpp b/src/other/applicationmanager.cpp index a391187..9898ad6 100644 --- a/src/other/applicationmanager.cpp +++ b/src/other/applicationmanager.cpp @@ -116,6 +116,14 @@ ApplicationManager::~ApplicationManager() void ApplicationManager::registerApplication(Application *newApp) { + for (int i = mApps.count() - 1; i >= 0; --i) { + Application *app = mApps[i]; + if (app->name() == newApp->name()) { + app->kill(); + break; + } + } + mApps.push_back(newApp); // add to debug application table |