[virt-tools-list] [PATCH virt-viewer 2/2] Remove extra ref on SpiceDisplay

Jonathon Jongsma jjongsma at redhat.com
Wed Sep 10 18:42:14 UTC 2014


There's no need to ref the SpiceDisplay widget when adding it to a
container. The container will take its own ref.
---
 src/virt-viewer-display-spice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/virt-viewer-display-spice.c b/src/virt-viewer-display-spice.c
index 2ce42cf..e568cfb 100644
--- a/src/virt-viewer-display-spice.c
+++ b/src/virt-viewer-display-spice.c
@@ -298,7 +298,7 @@ virt_viewer_display_spice_new(VirtViewerSessionSpice *session,
                                       G_CONNECT_SWAPPED);
     update_display_ready(self);
 
-    gtk_container_add(GTK_CONTAINER(self), g_object_ref(self->priv->display));
+    gtk_container_add(GTK_CONTAINER(self), GTK_WIDGET(self->priv->display));
     gtk_widget_show(GTK_WIDGET(self->priv->display));
     g_object_set(self->priv->display,
                  "grab-keyboard", TRUE,
-- 
1.9.3




More information about the virt-tools-list mailing list