Re: glib ref counting problem
- From: Tristan Van Berkom <vantr touchtunes com>
- To: Stefan Kost <kost imn htwk-leipzig de>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: glib ref counting problem
- Date: Mon, 20 Sep 2004 10:37:49 -0400
Stefan Kost wrote:
[...]
I will try to make it clearer.
application creates the BtSong
BtSong->refct=1
the songs instance init creates the private BtPattern and BtSetup instances
and passes itself to their constructiors.
BtSong->refct=3
BtPattern->refct=1
BtSetup->refct=1
Why should (G_OBJECT(BtSong)->ref_count > 1) ?
BtPattern & BtSetup do *not* need a reference on BtSong if
BtPattern & BtSetup *belong* to BtSong.
- App creates (and "owns") BtSong
- BtSong creates (and "owns") BtPattern
- BtSong creates (and "owns") BtSetup
- App unref's BtSong
- BtSong unref's BtPattern
- BtSong unref's BtSetup
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]