Re: [Gegl-developer] status of gegl/image

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

 



Hi,

Daniel Rogers <daniel@xxxxxxxxxxxxxxxxx> writes:

> Didn't know I had to chain up on finalize and dispose, though it makes
> sense.  The glib happy way of chaining up btw, is:
> 
> static void
> finalize (GObject * gobject)
> {
> ~  blah ... blah
> ~  G_OBJECT_CLASS (g_type_class_peek_parent (GEGL_NAME_GET_CLASS
> (gobject) )->finalize(gobject);
> }

Is it? This is the first time I see this construct. The common way is
to store a pointer to the parent class peeked in the class_init
function and use that directly. For example:

 G_OBJECT_CLASS(parent_class)->finalize(gobject);

> | If you dont override the finalize or dispose of course
> | you dont have to, but if you do, you must remember to chain up,
> | else Glib with object debugging turned on (G_ENABLE_DEBUG and
> G_TYPE_DEBUG_OBJECTS
> | both defined) will crash in g_object_last_unref trying to dispose/finalize
> | that object.
> 
> well, it doesn't crash, but aparently causes other problems.

Yes, massive leakage for example.


Sven

[Index of Archives]     [Yosemite News]     [Yosemite Photos]     [gtk]     [GIMP Users]     [KDE]     [Gimp's Home]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux