Re: Chaining of dispose and finalize
- From: Russell Shaw <rjshaw netspace net au>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Chaining of dispose and finalize
- Date: Sat, 04 Sep 2004 13:51:42 +1000
Tristan Van Berkom wrote:
Russell Shaw wrote:
[...]
With lines like these to call the parent (i.e. GObject) functions in
view_dispose():
G_OBJECT_CLASS (parent_class)->dispose (view);
But in view_class_init() above, i did:
gobject_class->dispose=view_dispose,
so G_OBJECT_CLASS(parent_class)->dispose(view) will recursively call
itself
forever.
and in view_finalize():
G_OBJECT_CLASS (parent_class)->finialize (view);
So will this.
I didn't see my last mail come through but here's my quote:
The list was very slow last night.
"the gobject code always keeps a version of the class intact
(for quick reference at instantiation and for chaining)"
g_type_class_peek_parent() returns a pointer to the class structure that
is kept "intact", not the one that you overrided on your copy of that
class.
I didn't realize copies of classes were stored in the g_type system.
I found that "The Glib Object system v0.9.0" has the information
in it:
http://le-hacker.org/papers/gobject/ch05.html#howto-gobject-chainup
I had read only V0.8.0.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]