diff -urNp gnome-terminal-2.22.3-orig/src/terminal-window.c gnome-terminal-2.22.3/src/terminal-window.c --- gnome-terminal-2.22.3-orig/src/terminal-window.c 2008-08-01 16:23:04.000000000 +0530 +++ gnome-terminal-2.22.3/src/terminal-window.c 2008-08-01 23:29:19.000000000 +0530 @@ -1367,14 +1367,9 @@ selection_changed_callback (TerminalScre } static void -close_button_clicked_cb (GtkWidget *widget, GtkWidget *screen) +close_button_clicked_cb (GtkWidget *widget, TerminalScreen *screen) { - GtkWidget *notebook; - guint page_num; - - notebook = gtk_widget_get_parent (GTK_WIDGET (screen)); - page_num = gtk_notebook_page_num (GTK_NOTEBOOK (notebook), screen); - gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), page_num); + terminal_screen_close (screen); } static void @@ -1458,8 +1453,6 @@ terminal_window_add_screen (TerminalWind if (old == window) return; - g_object_ref (G_OBJECT (screen)); /* make our own new refcount */ - if (old) terminal_window_remove_screen (old, screen);