From 9c8f8982c1b51adf98785d05323c6ab32369a682 Mon Sep 17 00:00:00 2001 From: Jonathon Jongsma Date: Tue, 8 Mar 2016 14:28:24 -0600 Subject: usb-acl-helper: Avoid deadlock when cancelled cancelled_cb() (which is triggered when the GCancellable's "cancelled" signal is emitted) called spice_usb_acl_helper_close_acl(), which calls spice_usb_acl_helper_cleanup(), which in turn calls g_cancellable_disconnect(). Calling g_cancellable_disconnect() from within a "cancelled" handler results in a dealock, as mentioned in the documentation. Instead of closing the acl here, simply cancel the task here. The cleanup() call will happen when the SpiceUsbAclHelper object is destroyed. --- src/usb-acl-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usb-acl-helper.c b/src/usb-acl-helper.c index 4ed57b9..9a08fea 100644 --- a/src/usb-acl-helper.c +++ b/src/usb-acl-helper.c @@ -162,7 +162,7 @@ static void cancelled_cb(GCancellable *cancellable, gpointer user_data) { SpiceUsbAclHelper *self = SPICE_USB_ACL_HELPER(user_data); - spice_usb_acl_helper_close_acl(self); + spice_usb_acl_helper_cancel(self); } static void helper_child_watch_cb(GPid pid, gint status, gpointer user_data) -- cgit