[PATCH spice-gtk 08/16] channel-main: Make SpiceFileXferTask-s ref the channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



So that the channel sticks around while their callbacks are completing.

Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
---
 gtk/channel-main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gtk/channel-main.c b/gtk/channel-main.c
index 8e8a3a5..bd27ef4 100644
--- a/gtk/channel-main.c
+++ b/gtk/channel-main.c
@@ -1547,6 +1547,7 @@ static void file_xfer_task_free(SpiceFileXferTask *task)
     c = task->channel->priv;
     c->file_xfer_task_list = g_list_remove(c->file_xfer_task_list, task);
 
+    g_clear_object(&task->channel);
     g_clear_object(&task->file);
     g_clear_object(&task->file_stream);
     g_free(task);
@@ -2679,7 +2680,7 @@ static void file_xfer_send_start_msg_async(SpiceMainChannel *channel,
 
     task = spice_malloc0(sizeof(SpiceFileXferTask));
     task->id = ++xfer_id;
-    task->channel = channel;
+    task->channel = g_object_ref(channel);
     task->file = g_object_ref(file);
     task->flags = flags;
     task->cancellable = cancellable;
-- 
1.8.1.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]