[project @ 2006-03-27 00:19:19 by dsilvers]

Defer scheduling a refresh until the content is loaded. This prevents assertion failures in the rare case that a schedule_run ends up being called before a content object containing a refresh which is due is fully loaded

svn path=/import/netsurf/; revision=2193
This commit is contained in:
Daniel Silverstone 2006-03-27 00:19:19 +00:00
parent 9fd4526003
commit dc3287127a
2 changed files with 8 additions and 2 deletions

View File

@ -291,6 +291,7 @@ void browser_window_callback(content_msg msg, struct content *c,
c->url);
url[sizeof url - 1] = 0;
gui_window_set_url(bw->window, url);
bw->refresh_interval = -1;
}
break;
@ -366,6 +367,9 @@ void browser_window_callback(content_msg msg, struct content *c,
hotlist_visited(c);
free(bw->referer);
bw->referer = 0;
if (bw->refresh_interval != -1)
schedule(bw->refresh_interval,
browser_window_refresh, bw);
break;
case CONTENT_MSG_ERROR:
@ -455,8 +459,7 @@ void browser_window_callback(content_msg msg, struct content *c,
#endif
case CONTENT_MSG_REFRESH:
schedule(data.delay * 100,
browser_window_refresh, bw);
bw->refresh_interval = data.delay * 100;
break;
default:

View File

@ -95,6 +95,9 @@ struct browser_window {
/** Current fetch is download */
bool download;
/** Refresh interval (-1 if undefined) */
int refresh_interval;
};