[Spice-devel] [PATCH spice-gtk 3/4] qmp: release channel on dispose

Victor Toso victortoso at redhat.com
Thu Sep 27 11:22:04 UTC 2018


On Wed, Sep 26, 2018 at 06:56:23PM +0400, marcandre.lureau at redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
> 
> Do not leak the strong channel ref.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> ---
>  src/qmp-port.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/qmp-port.c b/src/qmp-port.c
> index bdc0c7e..89b27aa 100644
> --- a/src/qmp-port.c
> +++ b/src/qmp-port.c
> @@ -203,6 +203,8 @@ static void spice_qmp_port_dispose(GObject *gobject)
>      g_object_set_data(G_OBJECT(self->priv->channel),
>                        "spice-qmp-port", NULL);
>  
> +    g_clear_object(&self->priv->channel);
> +

Maybe remove the g_object_set_data above?

>      if (G_OBJECT_CLASS(spice_qmp_port_parent_class)->dispose)
>          G_OBJECT_CLASS(spice_qmp_port_parent_class)->dispose(gobject);
>  }
> -- 
> 2.19.0.271.gfe8321ec05
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180927/65b447eb/attachment.sig>


More information about the Spice-devel mailing list