Re: [PATCH virt-viewer 2/2] Remove extra ref on SpiceDisplay

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Sep 10, 2014 8:42 PM, "Jonathon Jongsma" <jjongsma@xxxxxxxxxx> 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@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/virt-tools-list

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list

[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux