glib ref counting problem
- From: Stefan Kost <kost imn htwk-leipzig de>
- To: gtk-app-devel-list gnome org
- Subject: glib ref counting problem
- Date: Thu, 16 Sep 2004 17:49:29 +0200
hi hi,
hope that someone can enlighten me with my understanding of the gobject
ref-counting regarding to object destruction.
I have a gobject called BtSong. Upon construction it creates instances of
BtPattern, BtSetup and son on where it passes itself along.
Thus each child object now holds a reference to the BtSong object.
When the application that initialy created the BtSong instance is done, it would
like to destroy the object with all the accosiated ressources. It therefore
calles g_object_unref(song);.
Now the problem is that this only decreases the ref-count from e.g. 5 to 4,
because the child objects still have their reference on it.
Therefore the dispose() routine is not called and therefore the BtSong does not
release (unref) its child objects.
Apparently I have not yet understand the gobject system fully :-(
Can anyone tell me how to do it properly?
Ciao
Stefan
--
\|/ Stefan Kost
<@ @> private business
+-oOO-(_)-OOo------------------------------------------------------ - - - - -
| __ Address Simildenstr. 5 HTWK Leipzig, Fb IMN, Postfach 301166
| /// 04277 Leipzig 04251 Leipzig
| __ /// Germany Germany
| \\\/// Phone +49341 2253538 +49341 30766101
| \__/ EMail st_kost_at_gmx.net kost_at_imn.htwk-leipzig.de
| WWW www.sonicpulse.de www.imn.htwk-leipzig.de/~kost/about.html
===-=-=--=---=---------------------------------- - - - - -
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]