[virt-tools-list] [virt-viewer v2 4/4] window: Don't take a reference on 'toolbar'

Fabiano Fidêncio fidencio at redhat.com
Tue Jun 28 15:33:00 UTC 2016


On Tue, Jun 28, 2016 at 5:23 PM, Fabiano Fidêncio <fidencio at redhat.com> wrote:
> From: Christophe Fergeau <cfergeau at redhat.com>
>
> VirtViewerTimedRevealer now derives from GtkEventBox/GtkContainer, so
> it follows GTK+ conventions and takes ownership of the floating ref on
> 'toolbar'. Since VirtViewerWindow and VirtViewerTimedRevealer will have
> the same lifespan, we don't need to own a reference on toolbar in
> VirtViewerWindow.
> ---
>  src/virt-viewer-window.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index bf48516..503e230 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -200,7 +200,7 @@ virt_viewer_window_dispose (GObject *object)
>      priv->subtitle = NULL;
>
>      g_value_unset(&priv->accel_setting);
> -    g_clear_object(&priv->toolbar);
> +    priv->toolbar = NULL;
>
>      G_OBJECT_CLASS (virt_viewer_window_parent_class)->dispose (object);
>  }
> @@ -1070,7 +1070,7 @@ virt_viewer_window_toolbar_setup(VirtViewerWindow *self)
>      GtkWidget *overlay;
>      VirtViewerWindowPrivate *priv = self->priv;
>
> -    priv->toolbar = g_object_ref(gtk_toolbar_new());
> +    priv->toolbar = 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);
> --
> 2.7.4
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list

Acked-by: Fabiano Fidêncio <fidencio at redhat.com>




More information about the virt-tools-list mailing list