Browse Source

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 5 years ago
parent
commit
1b49b43135
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      daemon/timerthread.c

+ 8
- 0
daemon/timerthread.c View File

@ -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