Re: When is g_object_ref needed ?
- From: Tristan Van Berkom <tvb gnome org>
- To: Frédéric Terraza <fterraza free fr>
- Cc: gtk-list gnome org
- Subject: Re: When is g_object_ref needed ?
- Date: Mon, 03 Oct 2005 14:12:24 -0400
Frédéric Terraza wrote:
Thanks. But there are still some mysteries. For example, this sequence :
my_pixmap = gdk_pixmap_new(...) ;
my_gc = gdk_gc_new(my_pixmap) ;
g_object_unref(my_pixmap) ;
g_object_unref(my_gc) ;
seems to lead to an error. I was told that g_object_unref(my_pixmap) ;
would unref my_gc too. And effectively, if I delete the
g_object_unref(my_gc) ; everything works fine.
Are there some others examples of dependancies in GDK/GTK ? (colormaps,
for example ?)
Personally I have to say that I find this alarming, to me the
line:
my_gc = gdk_gc_new (my_pixmap);
doesn't seem to imply that ownership of the newly created GdkGC
is given to the GdkDrawable. Furthermore it isn't documented
to in the api reference (at least not under gdk_gc_new() ).
I hate to ask you this but: Are you sure ? Can you reproduce
this in an isolated test case ?
Cheers,
-Tristan
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]