Fix destruction of nsgtk windows involving frames, fixes crashes on sites such as news.bbc.co.uk

svn path=/trunk/netsurf/; revision=3323
This commit is contained in:
Rob Kendrick 2007-06-10 14:59:47 +00:00
parent c5b8f914f7
commit 09f65cc095

View File

@ -555,9 +555,15 @@ void gui_window_destroy(struct gui_window *g)
LOG((" Scaffolding: %p", g->scaffold));
LOG((" Window name: %s", g->bw->name));
nsgtk_gui_window_detach_child(g);
/* If we're a top-level gui_window, destroy our scaffold */
if (g->scrolledwindow == 0)
if (g->scrolledwindow == NULL) {
gtk_widget_destroy(GTK_WIDGET(g->viewport));
nsgtk_scaffolding_destroy(g->scaffold);
} else {
gtk_widget_destroy(GTK_WIDGET(g->scrolledwindow));
}
free(g);