Re: GObject - problem, as usual



On Tue, Aug 01, 2006 at 12:10:15PM +0200, Tomasz Jankowski wrote:
I'm writing some application based on GObject and I have problem when I'm
trying to destroy object. I have two object A and B, A derives from GObject
and B derives from A. I declared my own finalize methods for both objects,
but when I'm destroying B object only B finalize function is executed.

And it has to call A's finalize:

    G_OBJECT_CLASS(B_parent_class)->finalize(object);

and A's finalize has to call finalize() of its parent:

    G_OBJECT_CLASS(A_parent_class)->finalize(object);

etc.

Why B finalize method overrides A finalize method

Because that's how method overriding works.

Yeti


--
Anonyms eat their boogers.



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