From c6c4747a28816b3d8b9b4271b7cdb2ec84bc3715 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Mon, 15 Apr 2013 19:49:36 +0100 Subject: [PATCH] Schedule fetches so the frontend can wait for a scheduled event, rather than busy-looping. --- desktop/netsurf.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 0b1cffe0a..5945b31a1 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -239,6 +239,10 @@ nserror netsurf_init(int *pargc, return ret; } +static void netsurf_fetch_callback(void *p) +{ + hlcache_poll(); +} /** * Gui NetSurf main loop. @@ -246,8 +250,9 @@ nserror netsurf_init(int *pargc, int netsurf_main_loop(void) { while (!netsurf_quit) { + if(fetch_active) + schedule(0, netsurf_fetch_callback, NULL); gui_poll(fetch_active); - hlcache_poll(); } return 0;