From 89793c21712fe11a1c52452911f12ac38e275d28 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Wed, 27 Feb 2008 18:38:41 +0000 Subject: Make content_reset actually do what it's meant to (i.e. reset the appropriate members) Fix up CONTENT_MSG_REFRESH scheduled events to gracefully the refresh URL disappearing from under them. svn path=/trunk/netsurf/; revision=3870 --- desktop/browser.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index 27fcd6ad1..ee3e7eed5 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -648,8 +648,14 @@ void browser_window_refresh(void *p) struct browser_window *bw = p; bool history_add = true; - assert(bw->current_content->status == CONTENT_STATUS_READY || - bw->current_content->status == CONTENT_STATUS_DONE); + assert(bw->current_content && + (bw->current_content->status == CONTENT_STATUS_READY || + bw->current_content->status == CONTENT_STATUS_DONE)); + + /* Ignore if the refresh URL has gone + * (may happen if a fetch error occurred) */ + if (!bw->current_content->refresh) + return; /* mark this content as invalid so it gets flushed from the cache */ bw->current_content->fresh = false; -- cgit v1.2.3