diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2016-06-29 16:29:04 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2016-06-30 10:09:04 +0200 |
commit | 183c84d07c62b6b0e9587208e5a8a0c808d72f32 (patch) | |
tree | c2850f9b2e3d5211edd89407d16d9e32e08eb821 | |
parent | 15432988ecc5ffb35de841ff902879b04d2d3e40 (diff) |
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.
-rw-r--r-- | src/channel-usbredir.c | 1 |
1 files changed, 1 insertions, 0 deletions
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 |