[Webkit-unassigned] [Bug 51241] [GTK] PlatformRefPtr should not be used with Gtk widgets

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Dec 19 23:57:10 PST 2010


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





--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com>  2010-12-19 23:57:10 PST ---
(In reply to comment #2)
> Is this necessarily an error for non-toplevel widgets?

It's not necessarily an error, you keep a reference, so that when the widget is desroyed you still have the reference and when PlatormRefPtr release the last reference the widget is finally destroyed. But that's not how we expect gtk+ widgets to work. PlatformRefPtr is supposed to be for taking the ownership of objects to release them when they are not needed anymore, gtk+ already does that for widgets, you create a widget, add it to a container and forget about it. 

> If you add a widget to a container from a PlatformRefPtr the reference count should still be fine, assuming the PlatformRefPtr goes out of scope.

No it isn't, when the widget is created by gtk+ it has a floating reference, then PlatformRefPtr consumes the reference, so that when the widget is added to the container it has a real reference, rather than a floating one which is what the container expects. If you use adoptPlatformRef to not take the reference and let the parent widget do it as expected, PlatformRefPtr would release a reference that it doesn't have.

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