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

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Wed Sep 26 14:56:23 UTC 2018


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);
+
     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



More information about the Spice-devel mailing list