a089ec2f5f
Resolves: rhbz#1217202 (virt-manager) May help with rhbz#1338042 (gnome-boxes)
30 lines
1.1 KiB
Diff
30 lines
1.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Christophe Fergeau <cfergeau@redhat.com>
|
|
Date: Wed, 29 Jun 2016 16:29:04 +0200
|
|
Subject: [PATCH] usbredir: Fix GTask leak
|
|
|
|
spice_usbredir_channel_disconnect_device_async() creates a GTask and
|
|
then calls g_task_run_in_thread(). This method will take the reference
|
|
it needs on the GTask, it does not take ownership of the passed-in
|
|
GTask. This means we need to unref the GTask we created after calling
|
|
g_task_run_in_thread(), otherwise we are going to leak the GTask, as
|
|
well as the channel it's associated with.
|
|
Since it's an USB redir channel, this also causes some USB device
|
|
manager/USB event thread leaks.
|
|
---
|
|
src/channel-usbredir.c | 1 +
|
|
1 file changed, 1 insertion(+)
|
|
|
|
diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
|
|
index 2c5feae..4d669c4 100644
|
|
--- a/src/channel-usbredir.c
|
|
+++ b/src/channel-usbredir.c
|
|
@@ -527,6 +527,7 @@ void spice_usbredir_channel_disconnect_device_async(SpiceUsbredirChannel *channe
|
|
|
|
g_return_if_fail(channel != NULL);
|
|
g_task_run_in_thread(task, _disconnect_device_thread);
|
|
+ g_object_unref(task);
|
|
}
|
|
|
|
G_GNUC_INTERNAL
|