diff options
author | Hans de Goede <hdegoede@redhat.com> | 2012-03-04 17:29:09 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2012-03-06 12:55:30 +0100 |
commit | 0fa14f928e69675ec3c8754adcd9df876d35d0f0 (patch) | |
tree | 7f97baf9e6403e9a5bf5cc97985ff68c9e7d68c5 | |
parent | 963c7ebd65648bd9e8d1c6dd8c4694ba654fb110 (diff) |
virt-viewer-display: Use a borrowed reference to session
Before this patch there was a cyclic reference between VirtViewerSesion and
VirtViewerDisplay, since all VirtViewerDisplays are created / destroyed by
VirtViewerSession it is safe to assume that lifetime of VirtViewerSession >=
VirtViewerDisplay, so VirtViewerDisplay can take a borrowed reference
breaking the circle, and allowing proper cleanup on exit.
Note that there is no g_object_unref removed from virt-viewer-display, this
because there is no finalize / dispose and before this patch
VirtViewerDisplay never unref-ed the reference it hold to the session.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | src/virt-viewer-display.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/virt-viewer-display.c b/src/virt-viewer-display.c index ec4fe52..40d23ad 100644 --- a/src/virt-viewer-display.c +++ b/src/virt-viewer-display.c @@ -268,7 +268,7 @@ virt_viewer_display_set_property(GObject *object, break; case PROP_SESSION: g_warn_if_fail(priv->session == NULL); - priv->session = g_value_dup_object(value); + priv->session = g_value_get_object(value); break; default: |