From 3a8b8485adc6a0e5e1d8182b64951d077b842093 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Sun, 28 Dec 2003 16:17:31 +0000 Subject: [project @ 2003-12-28 16:17:31 by jmb] Fix bug in HTTP auth where trying to fetch a page into a non-existent browser window caused NetSurf to fall over. We now check that the window still exists. If not, we ignore the request. svn path=/import/netsurf/; revision=464 --- desktop/browser.c | 3 +++ desktop/gui.h | 1 + 2 files changed, 4 insertions(+) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 67f43cba2..e6011e2c3 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -209,6 +209,9 @@ void browser_window_open_location_historical(struct browser_window* bw, assert(bw != 0 && url != 0); + /* Check window still exists, if not, don't bother going any further */ + if (!gui_window_in_list(bw->window)) return; + if (bw->url != NULL) browser_window_destroy(bw, false); diff --git a/desktop/gui.h b/desktop/gui.h index 72ead54b4..61b3088b5 100644 --- a/desktop/gui.h +++ b/desktop/gui.h @@ -18,6 +18,7 @@ typedef struct gui_window gui_window; #include #include "netsurf/desktop/browser.h" +bool gui_window_in_list(gui_window *g); gui_window *gui_create_browser_window(struct browser_window *bw); gui_window *gui_create_download_window(struct content *content); void gui_window_destroy(gui_window* g); -- cgit v1.2.3