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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jan 19 23:48:24 PST 2014


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





--- Comment #5 from Carlos Garcia Campos <cgarcia at igalia.com>  2014-01-19 23:45:56 PST ---
(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.

-- 
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