GNOME Bugzilla – Bug 430746
Combobox might emit a signal during finalize
Last modified: 2007-05-03 16:21:55 UTC
In gtk_combo_box_finalize, the combobox destroys the popup widget. This might lead to a gtk_widget_unparent call which in turn changes the focus of the combobox widget. This emits a set-focus-child signal on the object being finalized, resulting in a segfault. This does not happen in normal situations, because the whole widget hierarchy is normally destroyed before finalize is called, but it might become a problem in some tricky situations (as in gtkmm for instance).
Created attachment 86518 [details] [review] Proposed patch This patch destroys the popup widget in dispose in addition to finalize.
Note that we have a gtkmm test case in which this is actually a problem.
Do we still need the same code in finalize then ?
I don't think so, but I am not sure, that's why I left it in. It should at least not do any harm.
I would also prefer not to see same code twice. We should know what is likely to happen. If we are wrong, I guess we'll find out. Matthias, if the code is removed from finalize, may we commit this, to fix the gtkmm problem?
Yes
I committed the patch with the duplicate code removed from finalize.
Could you commit this to the gtk-2-10 branch too, please. It seems to only be in trunk now.
Done.