From 613fa0213a90c8190aab14318890090d4b60b60c Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Wed, 14 Apr 2010 09:59:23 +0000 Subject: Simplify gtk scheduler and clean up valgrind-exposed error svn path=/trunk/netsurf/; revision=10397 --- gtk/gtk_schedule.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gtk/gtk_schedule.c b/gtk/gtk_schedule.c index 3ef98a40d..667cf1b48 100644 --- a/gtk/gtk_schedule.c +++ b/gtk/gtk_schedule.c @@ -33,7 +33,6 @@ typedef struct { void (*callback)(void *); /**< The callback function. */ void *context; /**< The context for the callback. */ bool callback_killed; /**< Whether or not this was killed. */ - bool callback_fired; /**< Whether or not this has fired yet. */ } _nsgtk_callback_t; /** List of callbacks which have occurred and are pending running. */ @@ -50,12 +49,7 @@ nsgtk_schedule_generic_callback(gpointer data) if (cb->callback_killed) { /* This callback instance has been killed. */ LOG(("CB at %p already dead.", cb)); - free(cb); - return FALSE; } - LOG(("CB for %p(%p) set pending.", cb->callback, cb->context)); - /* The callback is alive, so move it to pending. */ - cb->callback_fired = true; queued_callbacks = g_list_remove(queued_callbacks, cb); pending_callbacks = g_list_append(pending_callbacks, cb); return FALSE; @@ -101,7 +95,7 @@ schedule(int t, void (*callback)(void *p), void *p) schedule_remove(callback, p); cb->callback = callback; cb->context = p; - cb->callback_killed = cb->callback_fired = false; + cb->callback_killed = false; /* Prepend is faster right now. */ queued_callbacks = g_list_prepend(queued_callbacks, cb); g_timeout_add(msec_timeout, nsgtk_schedule_generic_callback, cb); -- cgit v1.2.3