[virt-tools-list] [PATCH 04/11] virt-viewer-app: main_window is part of our windows hashtable

Hans de Goede hdegoede at redhat.com
Sun Mar 4 19:05:55 UTC 2012


This means that:
1) There is no need to explictly set its title separately
2) It is unref-ed when we do g_hash_table_unref(priv->windows), so it
   should not be unref-ed separately otherwise it is unref-ed twice!

Notice that 2 was never a problem because of circular references
between VirtViewerApp and VirtViewerWindow, but once the follow
up patch to this one breaks the circle 2 becomes an issue.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/virt-viewer-app.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 86a059a..6fb83f6 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -450,7 +450,6 @@ set_title(gpointer key,
 static void
 virt_viewer_app_set_all_window_subtitles(VirtViewerApp *app)
 {
-    virt_viewer_app_set_window_subtitle(app, app->priv->main_window, 0);
     g_hash_table_foreach(app->priv->windows, set_title, app);
 }
 
@@ -1225,10 +1224,6 @@ virt_viewer_app_dispose (GObject *object)
     if (priv->windows) {
         g_hash_table_unref(priv->windows);
         priv->windows = NULL;
-    }
-
-    if (priv->main_window) {
-        g_object_unref(priv->main_window);
         priv->main_window = NULL;
     }
 
-- 
1.7.7.6




More information about the virt-tools-list mailing list