summaryrefslogtreecommitdiffstats
path: root/src/usb-acl-helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usb-acl-helper.c')
-rw-r--r--src/usb-acl-helper.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/usb-acl-helper.c b/src/usb-acl-helper.c
index d1fdfbe..36d0418 100644
--- a/src/usb-acl-helper.c
+++ b/src/usb-acl-helper.c
@@ -38,6 +38,7 @@ struct _SpiceUsbAclHelperPrivate {
GTask *task;
GIOChannel *in_ch;
GIOChannel *out_ch;
+ GCancellable *cancellable;
gulong cancellable_id;
};
@@ -52,8 +53,7 @@ static void spice_usb_acl_helper_cleanup(SpiceUsbAclHelper *self)
{
SpiceUsbAclHelperPrivate *priv = self->priv;
- g_cancellable_disconnect(g_task_get_cancellable(priv->task),
- priv->cancellable_id);
+ g_cancellable_disconnect(priv->cancellable, priv->cancellable_id);
priv->cancellable_id = 0;
g_clear_object(&priv->task);
@@ -104,7 +104,6 @@ static gboolean cb_out_watch(GIOChannel *channel,
SpiceUsbAclHelperPrivate *priv = self->priv;
gboolean success = FALSE;
GError *err = NULL;
- GCancellable *cancellable;
GIOStatus status;
gchar *string;
gsize size;
@@ -144,8 +143,7 @@ static gboolean cb_out_watch(GIOChannel *channel,
return TRUE; /* Wait for more input */
}
- cancellable = g_task_get_cancellable(priv->task);
- g_cancellable_disconnect(cancellable, priv->cancellable_id);
+ g_cancellable_disconnect(priv->cancellable, priv->cancellable_id);
priv->cancellable_id = 0;
if (!success)
@@ -250,6 +248,7 @@ void spice_usb_acl_helper_open_acl(SpiceUsbAclHelper *self,
priv->task = task;
if (cancellable) {
+ priv->cancellable = cancellable;
priv->cancellable_id = g_cancellable_connect(cancellable,
G_CALLBACK(cancelled_cb),
self, NULL);