From e84cf9a425258598e56aa2e30f3f2c40bd61a750 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Fri, 31 Jan 2014 16:12:25 +0000 Subject: [PATCH] don't add timer twice --- src/run_loop_embedded.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/run_loop_embedded.c b/src/run_loop_embedded.c index 93d309bf4..cbd01dbce 100644 --- a/src/run_loop_embedded.c +++ b/src/run_loop_embedded.c @@ -101,6 +101,11 @@ static void embedded_add_timer(timer_source_t *ts){ #ifdef HAVE_TICK linked_item_t *it; for (it = (linked_item_t *) &timers; it->next ; it = it->next){ + // don't add timer that's already in there + if ((timer_source_t *) it->next == ts){ + log_error( "run_loop_timer_add error: timer to add already in list!\n"); + return; + } if (ts->timeout < ((timer_source_t *) it->next)->timeout) { break; }