glib ref counting problem

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?

      \|/            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
|           WWW
===-=-=--=---=---------------------------------- - - -  -    -

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