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

Christophe Fergeau cfergeau at redhat.com
Tue Apr 9 03:10:59 PDT 2013


ACK

On Fri, Mar 29, 2013 at 12:40:20PM +0100, Hans de Goede wrote:
> So that the channel sticks around while their callbacks are completing.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  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 at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130409/cd18044e/attachment-0001.pgp>


More information about the Spice-devel mailing list