summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-08-21 06:03:58 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-08-21 06:03:58 +0000
commit82983e4f406d388b5219a496de7b0cf0c71d0570 (patch)
tree831d00fc8c77ce6831900deaa98b5a4af1eb5a16
parent5d6b30fa86480b1d22da9172da9b15a15b2cd900 (diff)
Leave timeout in context->ltimeouts list before calling the callback
-rw-r--r--common/glib-ectomy.c5
1 files changed, 3 insertions, 2 deletions
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;