After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 430746 - Combobox might emit a signal during finalize
Combobox might emit a signal during finalize
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkComboBox
unspecified
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 422955
 
 
Reported: 2007-04-17 18:40 UTC by Armin Burgmeier
Modified: 2007-05-03 16:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (2.07 KB, patch)
2007-04-17 18:42 UTC, Armin Burgmeier
committed Details | Review

Description Armin Burgmeier 2007-04-17 18:40:42 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).
Comment 1 Armin Burgmeier 2007-04-17 18:42:27 UTC
Created attachment 86518 [details] [review]
Proposed patch

This patch destroys the popup widget in dispose in addition to finalize.
Comment 2 Murray Cumming 2007-04-18 16:07:32 UTC
Note that we have a gtkmm test case in which this is actually a problem.
Comment 3 Matthias Clasen 2007-04-19 03:50:28 UTC
Do we still need the same code in finalize then ?
Comment 4 Armin Burgmeier 2007-04-19 17:19:26 UTC
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.
Comment 5 Murray Cumming 2007-05-01 20:42:14 UTC
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?
Comment 6 Matthias Clasen 2007-05-01 22:23:25 UTC
Yes
Comment 7 Armin Burgmeier 2007-05-02 22:19:44 UTC
I committed the patch with the duplicate code removed from finalize.
Comment 8 Murray Cumming 2007-05-03 07:48:18 UTC
Could you commit this to the gtk-2-10 branch too, please. It seems to only be in trunk now.
Comment 9 Armin Burgmeier 2007-05-03 16:21:55 UTC
Done.