[Webkit-unassigned] [Bug 127246] [GLIB] GVariant floating references are not correctly handled by GRefPtr

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 20 06:46:37 PST 2014


https://bugs.webkit.org/show_bug.cgi?id=127246





--- Comment #8 from Adrian Perez <aperez at igalia.com>  2014-01-20 06:44:09 PST ---
(In reply to comment #7)
> (In reply to comment #5)
> > (In reply to comment #4)
> > > (In reply to comment #3)
> > > > You might want to adopt a full reference. We don't want to use adoptGRef with GVariants having a floating reference
> > > 
> > > Then, could you please add something like the solution outlined in (b)
> > > to make it a compiler error to use adoptGRef() on a GVariant? That would
> > > prevent all of us of making the mistake.
> > 
> > Using adoptGRef with a GVariant is not a mistake, if the GVariant has a full reference and you want to adopt it. That's what happens with some methods like g_dbus_proxy_call_sync that return a full reference that you want to adopt. We might check if the GVariant has a floating reference and assert (or warning) in that case, but I don't think it's worth it, TBH. You are supposed to know how it works, like with GtkWidget, even when not using smart pointers. If it helps I can document in the wiki how to use initially unowned references with our smart pointers.
> 
> Ah, understood. I am writing a wiki page explaining how to use GRefPtr
> so it is easier for people starting to hack in WebKitGTK+ to use it
> properly.

Done: https://trac.webkit.org/wiki/GRefPtr

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list