Re: [Spice-devel] [spice-gtk v1 2/2] spice-widget: fix leak of boxed type cursor-shape

2018-04-04 Thread Victor Toso
On Wed, Apr 04, 2018 at 05:01:16AM -0400, Frediano Ziglio wrote:
> > 
> > From: Victor Toso 
> > 
> > No valgrind on this one but a leak similar to previous patch.
> > This one was introduced in e691954be459087
> > 
> > Signed-off-by: Victor Toso 
> > ---
> >  src/spice-widget.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/src/spice-widget.c b/src/spice-widget.c
> > index b60ca2b..1b79ad3 100644
> > --- a/src/spice-widget.c
> > +++ b/src/spice-widget.c
> > @@ -2993,6 +2993,7 @@ static void channel_new(SpiceSession *s, SpiceChannel
> > *channel, gpointer data)
> >  g_object_get(G_OBJECT(channel), "cursor", _shape, NULL);
> >  if (cursor_shape != NULL) {
> >  cursor_set(d->cursor, NULL, display);
> > +g_boxed_free(spice_cursor_shape_get_type(), cursor_shape);
> >  }
> >  return;
> >  }
> 
> Why not using SPICE_TYPE_CURSOR_SHAPE ?

Ah, yes, that's better!

> You can release cursor_shape even before calling cursor_set.

Indeed. I'll move it up and send a v2.
Thanks for the review,

toso


signature.asc
Description: PGP signature
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel


Re: [Spice-devel] [spice-gtk v1 2/2] spice-widget: fix leak of boxed type cursor-shape

2018-04-04 Thread Frediano Ziglio
> 
> From: Victor Toso 
> 
> No valgrind on this one but a leak similar to previous patch.
> This one was introduced in e691954be459087
> 
> Signed-off-by: Victor Toso 
> ---
>  src/spice-widget.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index b60ca2b..1b79ad3 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -2993,6 +2993,7 @@ static void channel_new(SpiceSession *s, SpiceChannel
> *channel, gpointer data)
>  g_object_get(G_OBJECT(channel), "cursor", _shape, NULL);
>  if (cursor_shape != NULL) {
>  cursor_set(d->cursor, NULL, display);
> +g_boxed_free(spice_cursor_shape_get_type(), cursor_shape);
>  }
>  return;
>  }

Why not using SPICE_TYPE_CURSOR_SHAPE ?
You can release cursor_shape even before calling cursor_set.

Frediano
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel