Merge lp:~ricmm/unity-mir/catch-starting-failure into lp:unity-mir

Proposed by Ricardo Mendoza
Status: Merged
Approved by: Gerry Boland
Approved revision: 171
Merged at revision: 173
Proposed branch: lp:~ricmm/unity-mir/catch-starting-failure
Merge into: lp:unity-mir
Diff against target: 41 lines (+12/-5)
1 file modified
src/modules/Unity/Application/application_manager.cpp (+12/-5)
To merge this branch: bzr merge lp:~ricmm/unity-mir/catch-starting-failure
Reviewer Review Type Date Requested Status
Gerry Boland (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+203920@code.launchpad.net

Commit message

Catch application crashes when Application status is still ::Starting.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
No
 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
No

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

LGTM

review: Approve
Revision history for this message
Gerry Boland (gerboland) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
 * Did CI run pass? If not, please explain why.
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/modules/Unity/Application/application_manager.cpp'
2--- src/modules/Unity/Application/application_manager.cpp 2014-01-16 11:57:16 +0000
3+++ src/modules/Unity/Application/application_manager.cpp 2014-01-30 11:05:03 +0000
4@@ -370,7 +370,7 @@
5 removeApplication = true;
6 }
7
8- if (application->state() == Application::Running) {
9+ if (application->state() == Application::Running || application->state() == Application::Starting) {
10 // Application probably crashed, else OOM killer struck. Either way state wasn't saved
11 // so just remove application
12 removeApplication = true;
13@@ -574,9 +574,16 @@
14 // in case application closed not by hand of shell, check again here:
15 Application* application = findApplicationWithSession(session);
16 if (application) {
17- application->setState(Application::Stopped);
18- application->setSession(nullptr);
19- m_dbusWindowStack->WindowDestroyed(0, application->appId());
20+ bool removeApplication = true;
21+
22+ if (application->state() != Application::Starting) {
23+ application->setState(Application::Stopped);
24+ application->setSession(nullptr);
25+ m_dbusWindowStack->WindowDestroyed(0, application->appId());
26+ if (application != m_focusedApplication) {
27+ removeApplication = false;
28+ }
29+ }
30
31 if (m_mainStageApplication == application)
32 m_mainStageApplication = nullptr;
33@@ -584,7 +591,7 @@
34 if (m_sideStageApplication == application)
35 m_sideStageApplication = nullptr;
36
37- if (application == m_focusedApplication) {
38+ if (removeApplication) {
39 // TODO(greyback) What to do?? Focus next app, or unfocus everything??
40 m_focusedApplication = NULL;
41 remove(application);

Subscribers

People subscribed via source and target branches