Re: Widget ref-count on creation



Russell Shaw wrote:
[...]
This implies that GtkObject is created differently to GObject. However, in
gtkobject.c, gtk_object_new() simply creates a GObject.

So, the above explanation about floating references is really only a
matter of notation, because the floating reference is stored as a
"normal" reference.

    It is stored as a normal reference, but the application programmer should
not have to worry about that, a floating reference is different than a
normal reference by definition (as one is not expected to fool around
with G_OBJECT(widget)->ref_count or (GTK_OBJECT(widget)->flags & GTK_FLOATING)).

I guess that if the gobject implementation included an `unref' function on
the class struct (idealy IMHO), it could have been polymorphed at the GtkObject
level and "denied" if the object was still floating, instead there is a warning
message in the GtkObject's finalize method to discourage this behaviour.

Cheers,
                                     -Tristan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]