GNOME Bugzilla – Bug 151486
GtkComboBoxEntry crashes with no model
Last modified: 2004-12-22 21:47:04 UTC
I have found a way to reproduce a crash with the GtkComboBoxEntry using Gtk 2.4.0 (on Fedora Core 2) and 2.4.7 (on Windows). If you use Glade and create a simple dialog with some widgets you can demonstrate this bug. I use a GtkHBox with a size of 3. I then add some buttons in the top and the GtkComboBoxEntry in the middle. I select one of the buttons with the mouse, and then use the arrow keys (left or right to make sure it is moving between the widgets OK) and move down to the GtkComboBoxEntry. The moment I press UP to move back to the buttons, Glade crashes. I have used Glade for this example, because the same thing happens in my application and it is easier to reproduce using Glade. It turns out, if you have test data in the GtkComboBoxEntry this doesn't occur at all. If you don't you will get this error in your application when you press UP (which I believe tries to use an entry in the model): <...> Gtk: ** CRITICAL ** file gtkliststore.c: line 570 (gtk_list_store_get_value): assertion `GTK_LIST_STORE (tree_model)->stamp == iter->stamp' failed GLib-GObject: ** WARNING ** gtype.c:3350: type id `0' is invalid GLib-GObject: ** WARNING ** can't peek value table for type `<invalid>' which is not currently referenced <...> I have tried creating creating an empty GtkListStore and assigning it to the GtkComboBoxEntry too, but get the same result. Pressing DOWN in my application doesn't have the same result, probably because focus is switched to another widget.
I believe I recently fixed this on HEAD: Thu Aug 26 23:58:11 2004 Matthias Clasen <maclas@gmx.de> * gtk/gtkcombobox.c (gtk_combo_box_key_press): Don't crash if model is not set. Noted by Mariano Suarez-Alvarez. Please reopen if you still see this after this change, or if you see it with 2.4.x