Re: Chaining of dispose and finalize
- From: Tristan Van Berkom <vantr touchtunes com>
- To: Russell Shaw <rjshaw netspace net au>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Chaining of dispose and finalize
- Date: Fri, 03 Sep 2004 15:52:20 -0400
Russell Shaw wrote:
[...]
Obviously something very basic i'm missing here;)
Maybe i should record the parent functions in static pointers
before overiding them:
[...]
G_OBJECT_CLASS(parent_class)->dispose=myobject_dispose;
G_OBJECT_CLASS(parent_class)->finalize=myobject_finalize;
That is really backwards :-O
In your class init, you override dispose on YOUR COPY of the GObjectClass
struct with myobject_dispose.
then you obtain a pointer to the IN TACT / READ ONLY copy of the GObjectClass
struct with g_type_class_peek_parent.
then in your dispose implementation which is called on YOUR COPY of the
GObjectClass, you chain up to the IN TACT function which still resides
in the READ ONLY `parent_class' pointer.
Does that clarify things ?
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]