Re: [spice-gtk 2/3] wocky: Set ConnectAsyncData instance as GTask data

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

 



Hi,

On Wed, Aug 03, 2016 at 09:49:52AM +0200, Christophe Fergeau wrote:
> Currently, the ConnectAsyncData instance is leaked if for example
> we trigger one codepath calling g_task_return_error(). If we
> associate it with the GTask with g_task_set_task_data(),
> this kind of leak will be avoided.
> ---
>  src/wocky-http-proxy.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/wocky-http-proxy.c b/src/wocky-http-proxy.c
> index d1519b8..cf51ba3 100644
> --- a/src/wocky-http-proxy.c
> +++ b/src/wocky-http-proxy.c
> @@ -363,6 +363,8 @@ wocky_http_proxy_connect_async (GProxy *proxy,
>    data->length = strlen (data->buffer);
>    data->offset = 0;
>  
> +  g_task_set_task_data (task, data, (GDestroyNotify)free_connect_data);
> +
>    if (WOCKY_IS_HTTPS_PROXY (proxy))
>      {
>        GError *error = NULL;
> @@ -456,7 +458,6 @@ reply_read_cb (GObject *source,
>  
>    g_task_return_pointer (data->task, data->io_stream, (GDestroyNotify) g_object_unref);
>    data->io_stream = NULL;
> -  free_connect_data (data);
>    g_object_unref (data->task);

Acked-by: Victor Toso <victortoso@xxxxxxxxxx>

(The rebased version)

Cheers,
  toso
>  }
>  
> -- 
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
_______________________________________________
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]