summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-03-04 16:49:11 +0100
committerHans de Goede <hdegoede@redhat.com>2012-03-06 12:55:30 +0100
commit963c7ebd65648bd9e8d1c6dd8c4694ba654fb110 (patch)
treecc382df876952424f562aab8e60b48572a099b32
parent01e553d21b52d31d8fc8b315e425cb7ae9dbf7d1 (diff)
virt-viewer-window: Use a borrowed reference to app
Before this patch there was a cyclic reference between VirtViewerApp and VirtViewerWindow, since all VirtViewerWindows are created / destroyed by VirtViewerApp it is safe to assume that lifetime of VirtViewerApp >= VirtViewerWindow, so VirtViewerWindow can take a borrowed reference breaking the circle, and allowing proper cleanup on exit. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--src/virt-viewer-window.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index e2f5425..2a6f0f4 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -164,7 +164,7 @@ virt_viewer_window_set_property (GObject *object, guint property_id,
case PROP_APP:
g_return_if_fail(priv->app == NULL);
- priv->app = g_value_dup_object(value);
+ priv->app = g_value_get_object(value);
break;
default:
@@ -183,11 +183,6 @@ virt_viewer_window_dispose (GObject *object)
priv->display = NULL;
}
- if (priv->app) {
- g_object_unref(priv->app);
- priv->app = NULL;
- }
-
g_free(priv->subtitle);
priv->subtitle = NULL;
}