[362] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: [gtk+970606] problems with gtk_widget_destroy()
daemon@ATHENA.MIT.EDU (David Mosberger-Tang)
Sat Jun 14 16:05:16 1997
Date: Sat, 14 Jun 1997 13:04:54 -0700
From: David Mosberger-Tang <davidm@azstarnet.com>
To: pmattis@parker.EECS.Berkeley.EDU, gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
David Mosberger-Tang writes:
David> Unfortunately, I don't have much time to track this down. It looks
David> like inserting a vbox into an hbox via a gtk_container_add()
David> increments the ref count in the vbox by two.
Peter Mattis writes:
Pete> That is exactly what is happening. gtk_container_add calls
Pete> gtk_widget_set_parent which is where widgets (objects) get
Pete> referenced. But the box container_add functions also calls
Pete> gtk_widget_set_parent, referencing the widget again. I've gone through
Pete> gtk and fixed places where this occurs. I've also put code into
Pete> gtk_widget_set_parent so that it will warn you if you set the parent
Pete> of a widget to its current value (which is what happened in this case)
Pete> or if you call gtk_widget_set_parent when the widgets parent field is
Pete> non-NULL. (ie. It already has a parent).
Pete> A patch to do all this follows. (gzipped and uuencoded)
The patch definitely does the trick for xscanimage. Neat!
--david
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null