[virt-tools-list] [PATCH virt-viewer 3/4] Fix a floating display warning

Christophe Fergeau cfergeau at redhat.com
Tue Jun 10 13:38:43 UTC 2014


On Tue, Jun 10, 2014 at 02:18:10PM +0200, Marc-André Lureau wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
> 
> (virt-viewer:7262): Gtk-WARNING **: A floating object was finalized. This means that someone
> called g_object_unref() on an object that had only a floating
> reference; the initial floating reference is not owned by anyone
> and must be removed with g_object_ref_sink().
> 
> That g_object_unref() was probably the wrong way to get rid of the floating ref.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1107518
> ---
>  src/virt-viewer-app.c     | 1 -
>  src/virt-viewer-session.c | 2 +-
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index b952faf..6c87c30 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -844,7 +844,6 @@ virt_viewer_app_display_added(VirtViewerSession *session G_GNUC_UNUSED,
>          if (priv->kiosk) {
>              /* don't show extra monitors that don't fit on client */
>              DEBUG_LOG("kiosk mode: skip extra monitors that don't fit on client");
> -            g_object_unref(display);

This seems to be fixing an unref on a reference we don't own, and
unrelated to the proper sinking of the floating ref which is achieved in
the next hunk. Is there a reason for having these 2 hunks together?

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20140610/3920e8b5/attachment.sig>


More information about the virt-tools-list mailing list