TT#14008 release all references held by timerthread on shutdown

This makes sure all objects are cleaned up during shutdown even if the
respective timer hasn't run yet.

Change-Id: I197b930f1b6e407819cc5a8c4ebd92fcef21b2cd
rfuchs/1283
Richard Fuchs 4 years ago
parent 58b566cda6
commit 1b49b43135

@ -14,7 +14,15 @@ void timerthread_init(struct timerthread *tt, void (*func)(void *)) {
tt->func = func;
}
static int __tt_put_all(void *k, void *d, void *p) {
struct timerthread_obj *tto = d;
//struct timerthread *tt = p;
obj_put(tto);
return FALSE;
}
void timerthread_free(struct timerthread *tt) {
g_tree_foreach(tt->tree, __tt_put_all, tt);
g_tree_destroy(tt->tree);
mutex_destroy(&tt->lock);
}

Loading…
Cancel
Save