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 475628 - Reusing GtkFileChooserWidget gives error messages
Reusing GtkFileChooserWidget gives error messages
Status: RESOLVED INCOMPLETE
Product: gtk+
Classification: Platform
Component: Widget: GtkFileChooser
2.10.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Federico Mena Quintero
filechooser-possible-obsolete
Depends on:
Blocks: 702853
 
 
Reported: 2007-09-10 22:00 UTC by Nikolaj Thygesen
Modified: 2014-03-28 13:44 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Nikolaj Thygesen 2007-09-10 22:00:17 UTC
Please describe the problem:
Reusing the same GtkFileChooserWidget multiple times sends error messages to the concole.

Steps to reproduce:
Run:

GtkWidget *window;
GtkWidget *file_widget;
gboolean delete_event(GtkWidget *widget, GdkEvent *event, void *)
{
    if(GtkWidget *sub = gtk_bin_get_child(GTK_BIN(window)))
        gtk_container_remove(GTK_CONTAINER(window), sub);
    else
        gtk_container_add(GTK_CONTAINER(window), file_widget);
    return TRUE;
}


int main()
{
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
file_widget = gtk_file_chooser_widget_new(GTK_FILE_CHOOSER_ACTION_SAVE);
g_object_ref(file_widget);
g_signal_connect(G_OBJECT(window), "delete_event", 
G_CALLBACK(delete_event), 0);
gtk_container_add(GTK_CONTAINER(window), file_widget);
gtk_widget_show_all(window);
gtk_main();
return 0;
}


Actual results:
Console shows messages like:

(DiamondBOX:18575): Gtk-CRITICAL **: gtk_tree_model_get_iter: assertion 
 `path != NULL' failed

 (DiamondBOX:18575): Gtk-CRITICAL **: gtk_list_store_set_valist: 
 assertion `VALID_ITER (iter, list_store)' failed

 (DiamondBOX:18575): Gtk-CRITICAL **: gtk_tree_model_get_iter: assertion 
 `path != NULL' failed

 (DiamondBOX:18575): Gtk-CRITICAL **: gtk_list_store_set_valist: 
 assertion `VALID_ITER (iter, list_store)' failed

 (DiamondBOX:18575): Gtk-CRITICAL **: gtk_tree_model_get_iter: assertion 
 `path != NULL' failed

 (DiamondBOX:18575): Gtk-CRITICAL **: gtk_list_store_set_valist: 
 assertion `VALID_ITER (iter, list_store)' failed


Expected results:
Nothing

Does this happen every time?
Yes

Other information:
Comment 1 Timothy Arceri 2013-06-29 02:27:35 UTC
Are you still having this problem? If so can you provide actual example code as an attachment to the bug? Your example code does not work at all for me.

I get Glib errors:
process:4285): GLib-GObject-CRITICAL **: /build/buildd/glib2.0-2.32.3/./gobject/gtype.c:2722: You forgot to call g_type_init()

(process:4285): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

etc
Comment 2 Javier Jardón (IRC: jjardon) 2014-03-28 13:44:53 UTC
Closing this bug report as no further information has been provided. Please feel free to reopen this bug if you can provide the information asked for.
Thanks!