Glib::wrap with copy=true semantics?
- From: Philip Langdale <plangdale vmware com>
- To: gtkmm-list mail gnome org
- Subject: Glib::wrap with copy=true semantics?
- Date: Thu, 03 Mar 2005 13:03:03 -0800
I have a scenario here where there is a GtkAdjustment owned by
a C gtk widget and a Gtkmm gets the adjustment and then wraps it
in a Gtkmm wrapper. The wrapper should pass copy=true because it
isn't the owner of the underlying GtkObject. However, what I
observe is that the wrapper is created and it increments the
adjustment's refcount as expected but when the wrapper dies, it
does not decrement the refcount, and it calls gtk_object_destroy
which seems incorrect. Because the other ref holders aren't
expecting destroy to be called, they do not release their refs
and the object ends up being leaked when the other ref olders
do release their refs because there is still a +1 thanks to
On the other hand, if I pass copy=false, it doesn't touch the
refcount at all and calls gtk_object_destroy when the wrapper
dies as you'd expect.
Is there a bug here or am I just expecting the wrong semantics?
] [Thread Prev