afc: Fix force unmount of devices
When unplugging an afc device without unmounting it first, the corresponding gvfsd-afc process does not go away in spite of the exit(1) workaround added for bgo#708288. This happens because idevice_event_unsubscribe() in called from the thread where the _idevice_event_cb() runs in. libimobiledevice (through libusbmuxd) creates a thread to watch for device events, and calls the idevice_event_cb_t from that thread. idevice_event_unsubscribe() then forcfully kills that thread (see usbmuxd_unsubscribe() in libusbmuxd), so exit(1) code after the call to idevice_event_unsubscribe() never gets a chance to run. Moving the call to idevice_event_unsubscribe() and the g_vfs_backend_force_unmount() call to run in the main loop through g_idle_add() avoids this issue, and allows the code handling force unmounts to run as expected. Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=708288
parent
e0b3c9e2
Please register or sign in to comment