Re: [PATCH spice-gtk 1/2] Don't unref GAsyncResult in callback

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

 



Hi

On Thu, May 31, 2018 at 8:35 PM, Jonathon Jongsma <jjongsma@xxxxxxxxxx> wrote:
> A GAsyncReadCallback function should not unref the GAsyncResult passed
> to it as an argument since it does not hold a reference. This could
> cause a double-free error (or a glib warning that it is not a valid
> GObject)..

Would be worth to have the critical or double-free backtrace, but your
analysis seems right to me.

This was introduced by commit 9fbf679453d8dbfe797a738cb536136599d7adab
"usbredir: Disconnect USB device asynchronously"

ack

> ---
>  src/channel-usbredir.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/src/channel-usbredir.c b/src/channel-usbredir.c
> index 0cc5630..b7445b0 100644
> --- a/src/channel-usbredir.c
> +++ b/src/channel-usbredir.c
> @@ -151,7 +151,6 @@ static void _channel_reset_cb(GObject *gobject,
>      SPICE_CHANNEL_CLASS(spice_usbredir_channel_parent_class)->channel_reset(spice_channel, migrating);
>
>      spice_usbredir_channel_disconnect_device_finish(channel, result, &err);
> -    g_object_unref(result);
>  }
>
>  static void spice_usbredir_channel_reset(SpiceChannel *c, gboolean migrating)
> --
> 2.14.3
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel



-- 
Marc-André Lureau
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://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]