Documentation states that:
 "Client applications may take a reference on the @task object and use
 it to monitor the status of the file transfer task."

We have been monitoring SpiceFileTransferTask without reference it but
since the introduction of file transfer dialog we also unref it after
task is finished (on task_finished_remove) leading to critical
warnings when task original reference has been freed already.

Signed-off-by: Victor Toso <[email protected]>
---
 src/virt-viewer-session-spice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 731f074..fdbfd5d 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -943,7 +943,7 @@ on_new_file_transfer(SpiceMainChannel *channel 
G_GNUC_UNUSED,
 {
     VirtViewerSessionSpice *self = VIRT_VIEWER_SESSION_SPICE(user_data);
     virt_viewer_file_transfer_dialog_add_task(self->priv->file_transfer_dialog,
-                                              task);
+                                              g_object_ref(task));
 }
 
 static void
-- 
2.7.4

_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to