From 82983e4f406d388b5219a496de7b0cf0c71d0570 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 21 Aug 2006 06:03:58 +0000 Subject: Leave timeout in context->ltimeouts list before calling the callback --- common/glib-ectomy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'common/glib-ectomy.c') diff --git a/common/glib-ectomy.c b/common/glib-ectomy.c index 2f674cbc..6bbee3f1 100644 --- a/common/glib-ectomy.c +++ b/common/glib-ectomy.c @@ -243,9 +243,8 @@ static void timeout_handlers_check(GMainContext *context) t = context->ltimeout->data; - context->ltimeout = slist_remove(context->ltimeout, t); - if (timercmp(&tv, &t->expiration, <)) { + context->ltimeout = slist_remove(context->ltimeout, t); context->processed = slist_append(context->processed, t); continue; } @@ -257,6 +256,8 @@ static void timeout_handlers_check(GMainContext *context) if (!slist_find(context->ltimeout, t, timeout_cmp)) continue; + context->ltimeout = slist_remove(context->ltimeout, t); + if (!ret) { free(t); continue; -- cgit