Re: GObject: Freeing memory of instance members?
- From: David Nečas (Yeti) <yeti physics muni cz>
- To: gtk-list gnome org
- Subject: Re: GObject: Freeing memory of instance members?
- Date: Sat, 5 May 2007 10:48:46 +0200
On Thu, May 03, 2007 at 08:16:23PM -0300, Alexandre Moreira wrote:
>
> At your class_init you should peek (g_type_class_peek_parent, using
> your class pointer as parameter) a pointer to your parent class and
> keep it in a global storage, accessible to your finalize.
Actually, what you should do is to use a macro from the
G_DEFINE_TYPE() family that does these things automaticaly
(the parent class variable is named <my_type>_parent_class).
> Then, in your finalize method you call the finalize method on this
> pointer you just got from peek_parent, something like:
>
> G_OBJECT_CLASS(parent_class)->finalize(pointer_to_the_object_being_finalized);
This still holds, except for the name.
Yeti
--
http://gwyddion.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]