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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Dec 17 02:38:46 PST 2010


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

           Summary: [GTK] PlatformRefPtr should not be used with Gtk
                    widgets
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Gtk
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: cgarcia at igalia.com


PlatformRefPtr breaks the widget life-cycle, the main problem is that PlatformRefPtr calls g_object_unref() when it's destroyed, which is undesirable for widgets. In gtk+ widgets are created with a floating reference and when added to a container, the container takes the ownership of the widget consuming the floating reference. So you don't usually need to call g_object_ref/unref on widgets (only for some operations like reparent a widget) and toplevel widgets are destroyed with gtk_widget_destroy(). 

There are some cases like EditorClientGtk where the widget used is not a toplevel and it's not going to be added to a container, in this case using PlatformRefPtr is correct, since you are taking the ownership of the widget.

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