Merge lp:~azzar1/unity/fix-1111389 into lp:unity

Proposed by Andrea Azzarone
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: no longer in the source branch.
Merged at revision: 3092
Proposed branch: lp:~azzar1/unity/fix-1111389
Merge into: lp:unity
Diff against target: 20 lines (+6/-4)
1 file modified
launcher/VolumeImp.cpp (+6/-4)
To merge this branch: bzr merge lp:~azzar1/unity/fix-1111389
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
PS Jenkins bot continuous-integration Pending
Review via email: mp+145844@code.launchpad.net

Commit message

Fix crash when unmounting android devices.

Description of the change

== Probelem ==
Unmounting and Android (iOS too?) device from unity crashes compiz.

== Fix ==
Call g_mount_unmount_with_operation_finish in the asyn callback.

== Test ==
Crash, not applicable.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Cool change looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'launcher/VolumeImp.cpp'
2--- launcher/VolumeImp.cpp 2012-11-06 18:19:09 +0000
3+++ launcher/VolumeImp.cpp 2013-01-31 13:27:31 +0000
4@@ -206,10 +206,12 @@
5 glib::Object<GMount> mount(g_volume_get_mount(volume_));
6 glib::Object<GMountOperation> op(gtk_mount_operation_new(nullptr));
7
8- g_mount_unmount_with_operation(mount,
9- (GMountUnmountFlags)0,
10- op,
11- cancellable_, nullptr, nullptr);
12+ g_mount_unmount_with_operation(mount, (GMountUnmountFlags) 0, op,
13+ cancellable_, [] (GObject* source_object, GAsyncResult* res, gpointer /*user_data*/)
14+ {
15+ GMount* mount = G_MOUNT(source_object);
16+ g_mount_unmount_with_operation_finish(mount, res, nullptr);
17+ }, nullptr);
18 }
19
20 VolumeImp* parent_;