Index: gedit-tab.c =================================================================== RCS file: /cvs/gnome/gedit/gedit/Attic/gedit-tab.c,v retrieving revision 1.1.2.66 diff -u -p -r1.1.2.66 gedit-tab.c --- gedit-tab.c 10 Dec 2005 19:20:35 -0000 1.1.2.66 +++ gedit-tab.c 11 Dec 2005 13:33:15 -0000 @@ -315,16 +315,28 @@ set_message_area (GeditTab *tab, (gpointer *)&tab->priv->message_area); } -static void -unrecoverable_loading_error_message_area_response (GeditMessageArea *message_area, - gint response_id, - GeditTab *tab) +static gboolean +remove_tab (GeditTab *tab) { GeditNotebook *notebook; notebook = GEDIT_NOTEBOOK (gtk_widget_get_parent (GTK_WIDGET (tab))); gedit_notebook_remove_tab (notebook, tab); + + return FALSE; +} + +static void +unrecoverable_loading_error_message_area_response (GeditMessageArea *message_area, + gint response_id, + GeditTab *tab) +{ + /* we are called from the handler of doc's "loaded" signal... + * schedule the tab remove in an idle handler to prevent corrupting + * tab and doc in the signal handler call chain + */ + g_idle_add ((GSourceFunc) remove_tab, tab); } static void