- loop->timers = g_slist_delete_link(loop->timers, it);
- g_free(curr);
- continue;
- }
-
- /* the queue is sorted, so if this timer shouldn't fire, none are
- ready */
- if (timecompare(&NEAREST_TIMEOUT(loop), &loop->now) <= 0)
- break;
-
- /* we set the last fired time to delay msec after the previous firing,
- then re-insert. timers maintain their order and may trigger more
- than once if they've waited more than one delay's worth of time.
- */
- loop->timers = g_slist_delete_link(loop->timers, it);
- g_time_val_add(&curr->last, curr->delay);
- if (curr->func(curr->data)) {
+ loop->timers = g_slist_delete_link(loop->timers, it);
+ if (curr->destroy)
+ curr->destroy(curr->data);
+ g_free(curr);
+ continue;
+ }
+
+ /* the queue is sorted, so if this timer shouldn't fire, none are
+ ready */
+ if (timecompare(&NEAREST_TIMEOUT(loop), &loop->now) < 0)
+ break;
+
+ /* we set the last fired time to delay msec after the previous firing,
+ then re-insert. timers maintain their order and may trigger more
+ than once if they've waited more than one delay's worth of time.
+ */
+ loop->timers = g_slist_delete_link(loop->timers, it);
+ g_time_val_add(&curr->last, curr->delay);
+ if (curr->func(curr->data)) {