ACK.

Christophe

On Tue, Apr 14, 2015 at 03:28:49PM -0500, Jonathon Jongsma wrote:
> On Tue, 2015-04-14 at 14:40 -0500, Jonathon Jongsma wrote:
> > In theory, the dispose method can be called multiple times, so any
> > member variables that are unreffed should be set to NULL so that we
> > don't accidentally unref them multiple times.
> > ---
> >  src/virt-viewer-session-spice.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/virt-viewer-session-spice.c 
> > b/src/virt-viewer-session-spice.c
> > index da193ec..40197b0 100644
> > --- a/src/virt-viewer-session-spice.c
> > +++ b/src/virt-viewer-session-spice.c
> > @@ -146,7 +146,7 @@ virt_viewer_session_spice_dispose(GObject *obj)
> >      spice->priv->audio = NULL;
> >  
> >      if (spice->priv->main_window)
> > -        g_object_unref(spice->priv->main_window);
> > +        g_clear_object(&spice->priv->main_window);
> >  
> >      G_OBJECT_CLASS(virt_viewer_session_spice_parent_class)->dispose(obj);
> >  }
> 
> ... and clearly I can just remove the if() check as long as I'm using
> g_clear_object().
> 
> _______________________________________________
> virt-tools-list mailing list
> [email protected]
> https://www.redhat.com/mailman/listinfo/virt-tools-list

Attachment: pgpiGIKDtK7o_.pgp
Description: PGP signature

_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to