diff options
author | Richard Hughes <richard@hughsie.com> | 2013-03-05 10:55:44 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2013-03-05 10:55:44 +0000 |
commit | fb3ff7d4687ca181ee4929b92bdf64520e6103d4 (patch) | |
tree | f5b7afd5724144948d7a85da9ea5e81d5c1dfc53 /gusb/gusb-device.c | |
parent | 1de426a1bf7b45ea045b6da62dcda84aa17a2a24 (diff) | |
download | gusb-fb3ff7d4687ca181ee4929b92bdf64520e6103d4.tar.gz |
Unref the GMainloop after it has been run, not when just quit
There may be pending events to process, and this fixes a crash in colord.
Diffstat (limited to 'gusb/gusb-device.c')
-rw-r--r-- | gusb/gusb-device.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gusb/gusb-device.c b/gusb/gusb-device.c index a3be218..d58ab4f 100644 --- a/gusb/gusb-device.c +++ b/gusb/gusb-device.c @@ -467,7 +467,6 @@ g_usb_device_sync_transfer_cb (GUsbDevice *device, { helper->ret = (*helper->finish_func) (device, res, helper->error); g_main_loop_quit (helper->loop); - g_main_loop_unref (helper->loop); } /** @@ -530,6 +529,7 @@ g_usb_device_control_transfer (GUsbDevice *device, (GAsyncReadyCallback) g_usb_device_sync_transfer_cb, &helper); g_main_loop_run (helper.loop); + g_main_loop_unref (helper.loop); if (actual_length != NULL) *actual_length = (gsize) helper.ret; @@ -584,6 +584,7 @@ g_usb_device_bulk_transfer (GUsbDevice *device, (GAsyncReadyCallback) g_usb_device_sync_transfer_cb, &helper); g_main_loop_run (helper.loop); + g_main_loop_unref (helper.loop); if (actual_length != NULL) *actual_length = (gsize) helper.ret; @@ -638,6 +639,7 @@ g_usb_device_interrupt_transfer (GUsbDevice *device, (GAsyncReadyCallback) g_usb_device_sync_transfer_cb, &helper); g_main_loop_run (helper.loop); + g_main_loop_unref (helper.loop); if (actual_length != NULL) *actual_length = helper.ret; |