[Spice-devel] [PATCH spice-server] display-channel: Clean more stuff on finalize

Christophe Fergeau cfergeau at redhat.com
Tue Feb 28 15:51:01 UTC 2017


On Tue, Feb 28, 2017 at 03:42:17PM +0000, Frediano Ziglio wrote:
> Release surfaces, cache and monitor configurations.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/display-channel.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/server/display-channel.c b/server/display-channel.c
> index 288969c..60947fc 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -77,9 +77,14 @@ static void
>  display_channel_finalize(GObject *object)
>  {
>      DisplayChannel *self = DISPLAY_CHANNEL(object);
> +    DisplayChannelPrivate *priv = self->priv;

Note: There are more changes in this patch caused by this cosmetic
change than cleanup additions (I'd just keep using self->priv throughout
_finalize())

>  
> -    g_array_unref(self->priv->video_codecs);
> -    g_free(self->priv);
> +    display_channel_destroy_surfaces(self);
> +    image_cache_reset(&priv->image_cache);

Could be display_channel_reset_image_cache()

Acked-by: Christophe Fergeau <cfergeau at redhat.com>

> +    g_array_unref(priv->video_codecs);
> +
> +    monitors_config_unref(priv->monitors_config);
> +    g_free(priv);
>  
>      G_OBJECT_CLASS(display_channel_parent_class)->finalize(object);
>  }
> -- 
> 2.9.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170228/b19cb887/attachment.sig>


More information about the Spice-devel mailing list