Merge lp:~gerboland/unity-2d/fix-onActiveWorkspaceChanged-crash into lp:unity-2d

Proposed by Gerry Boland
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1154
Merged at revision: 1155
Proposed branch: lp:~gerboland/unity-2d/fix-onActiveWorkspaceChanged-crash
Merge into: lp:unity-2d
Diff against target: 35 lines (+6/-2)
1 file modified
shell/launcher/LauncherList.qml (+6/-2)
To merge this branch: bzr merge lp:~gerboland/unity-2d/fix-onActiveWorkspaceChanged-crash
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+149895@code.launchpad.net

Commit message

[launcher] When item removed from launcher list model, the delegates is not removed immediately, but delayed so the closing animation can complete. Prevent accessing the model item while delegate removal is being delayed. Fixes multiple crashes.

Description of the change

[launcher] When item removed from launcher list model, the delegates is not removed immediately, but delayed so the closing animation can complete. Prevent accessing the model item while delegate removal is being delayed. Fixes multiple crashes.

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
Albert Astals Cid (aacid) wrote :

Makes sense

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/launcher/LauncherList.qml'
2--- shell/launcher/LauncherList.qml 2012-05-24 13:21:20 +0000
3+++ shell/launcher/LauncherList.qml 2013-02-21 17:41:34 +0000
4@@ -372,6 +372,8 @@
5 Connections {
6 target: declarativeView
7 onActivateShortcutPressed: {
8+ if (launcherItem.ListView.delayRemove) return /* This method could be called after item deleted */
9+
10 /* Only applications can be launched by keyboard shortcuts */
11 if (item.toString().indexOf("Application") == 0 && index == itemIndex) {
12 item.menu.hide()
13@@ -379,6 +381,8 @@
14 }
15 }
16 onNewInstanceShortcutPressed: {
17+ if (launcherItem.ListView.delayRemove) return
18+
19 /* Only applications can be launched by keyboard shortcuts */
20 if (item.toString().indexOf("Application") == 0 && index == itemIndex) {
21 item.menu.hide()
22@@ -389,11 +393,11 @@
23
24 Connections {
25 target: shellManager
26- onActiveWorkspaceChanged: updatePips()
27+ onActiveWorkspaceChanged: if (!launcherItem.ListView.delayRemove) updatePips()
28 }
29 Connections {
30 target: declarativeView.screen
31- onGeometryChanged: updatePips()
32+ onGeometryChanged: if (!launcherItem.ListView.delayRemove) updatePips()
33 }
34 Component.onCompleted: updatePips()
35 }

Subscribers

People subscribed via source and target branches