[virt-tools-list] [PATCHv2 virt-viewer 05/10] kiosk: keep a reference on the toolbar
Marc-André Lureau
marcandre.lureau at gmail.com
Fri Aug 16 19:47:41 UTC 2013
We are going to change the container content dynamically, so we need a
strong reference.
---
src/virt-viewer-window.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index f0fb9c2..74c020a 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -192,6 +192,7 @@ virt_viewer_window_dispose (GObject *object)
priv->subtitle = NULL;
g_value_unset(&priv->accel_setting);
+ g_clear_object(&priv->toolbar);
}
static void
@@ -1031,7 +1032,7 @@ virt_viewer_window_toolbar_setup(VirtViewerWindow *self)
GtkWidget *button;
VirtViewerWindowPrivate *priv = self->priv;
- priv->toolbar = gtk_toolbar_new();
+ priv->toolbar = g_object_ref(gtk_toolbar_new());
gtk_toolbar_set_show_arrow(GTK_TOOLBAR(priv->toolbar), FALSE);
gtk_widget_set_no_show_all(priv->toolbar, TRUE);
gtk_toolbar_set_style(GTK_TOOLBAR(priv->toolbar), GTK_TOOLBAR_BOTH_HORIZ);
--
1.8.3.rc1.49.g8d97506
More information about the virt-tools-list
mailing list