Author: jmb
Date: Wed Feb 27 18:38:41 2008
New Revision: 3870
URL:
http://source.netsurf-browser.org?rev=3870&view=rev
Log:
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.
Modified:
trunk/netsurf/content/content.c
trunk/netsurf/desktop/browser.c
trunk/netsurf/render/html.c
Modified: trunk/netsurf/content/content.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/content/content.c?rev=387...
==============================================================================
--- trunk/netsurf/content/content.c (original)
+++ trunk/netsurf/content/content.c Wed Feb 27 18:38:41 2008
@@ -931,6 +931,13 @@
c->size = 0;
talloc_free(c->mime_type);
c->mime_type = 0;
+ talloc_free(c->refresh);
+ c->refresh = 0;
+ talloc_free(c->title);
+ c->title = 0;
+ talloc_free(c->source_data);
+ c->source_data = 0;
+ c->source_size = c->source_allocated = 0;
}
Modified: trunk/netsurf/desktop/browser.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/desktop/browser.c?rev=387...
==============================================================================
--- trunk/netsurf/desktop/browser.c (original)
+++ trunk/netsurf/desktop/browser.c Wed Feb 27 18:38:41 2008
@@ -648,8 +648,14 @@
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;
Modified: trunk/netsurf/render/html.c
URL:
http://source.netsurf-browser.org/trunk/netsurf/render/html.c?rev=3870&am...
==============================================================================
--- trunk/netsurf/render/html.c (original)
+++ trunk/netsurf/render/html.c Wed Feb 27 18:38:41 2008
@@ -1563,7 +1563,12 @@
{
struct content *c = (struct content *)p;
- assert(c->type == CONTENT_HTML && c->refresh);
+ assert(c->type == CONTENT_HTML);
+
+ /* Ignore if refresh URL has gone
+ * (may happen if fetch errored) */
+ if (!c->refresh)
+ return;
c->fresh = false;