From 1b49b4313549cfc6d02b9ee9f9b5aeeb81dd957b Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 10 Jun 2021 13:32:34 -0400 Subject: [PATCH] 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 --- daemon/timerthread.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/daemon/timerthread.c b/daemon/timerthread.c index ee06bfa1d..136ff7f6c 100644 --- a/daemon/timerthread.c +++ b/daemon/timerthread.c @@ -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); }