mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-08 20:12:01 +03:00
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
This commit is contained in:
parent
748937547a
commit
89793c2171
@ -931,6 +931,13 @@ void content_reset(struct content *c)
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
|
@ -1563,7 +1563,12 @@ void html_object_refresh(void *p)
|
||||
{
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user