[virt-tools-list] [PATCH virt-viewer 2/2] Remove extra ref on SpiceDisplay

Fabiano Fidêncio fabiano at fidencio.org
Wed Sep 10 20:52:01 UTC 2014


On Sep 10, 2014 8:42 PM, "Jonathon Jongsma" <jjongsma at redhat.com> wrote:
>
> There's no need to ref the SpiceDisplay widget when adding it to a
> container. The container will take its own ref.

If we remove the SpiceDisplay from the container, it can unref the last
reference of the widget. Ack if you are sure that this is not the case why
the SpiceDisplay is ref'ed.

> ---
>  src/virt-viewer-display-spice.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/virt-viewer-display-spice.c
b/src/virt-viewer-display-spice.c
> index 2ce42cf..e568cfb 100644
> --- a/src/virt-viewer-display-spice.c
> +++ b/src/virt-viewer-display-spice.c
> @@ -298,7 +298,7 @@ virt_viewer_display_spice_new(VirtViewerSessionSpice
*session,
>                                        G_CONNECT_SWAPPED);
>      update_display_ready(self);
>
> -    gtk_container_add(GTK_CONTAINER(self),
g_object_ref(self->priv->display));
> +    gtk_container_add(GTK_CONTAINER(self),
GTK_WIDGET(self->priv->display));
>      gtk_widget_show(GTK_WIDGET(self->priv->display));
>      g_object_set(self->priv->display,
>                   "grab-keyboard", TRUE,
> --
> 1.9.3
>
> _______________________________________________
> virt-tools-list mailing list
> virt-tools-list at redhat.com
> https://www.redhat.com/mailman/listinfo/virt-tools-list
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140910/bd3ce1d1/attachment.htm>


More information about the virt-tools-list mailing list