aboutsummaryrefslogtreecommitdiffstats
path: root/afb-timer.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2019-01-04 14:25:55 +0100
committerRomain Forlot <romain.forlot@iot.bzh>2019-01-04 14:37:24 +0100
commit2e36a74fa8ae2a4b8e06f7752c3876f32a8dcbb3 (patch)
tree7b0eef73156c0e60f5b108005a2dd745db22112b /afb-timer.c
parentaba89b590ef0d1743dd0aa82a8b8ed1bf8809909 (diff)
Call the freeCB function a manual timer stop call
This invokes the freeCB callback function which is in charge of release allocated resources in the timer callback. This was only called on a normal stop of a timer not when called manually by TimerEvtStop. Change-Id: I750a62ee0662b905107f53d070add1e8ccba77f8 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'afb-timer.c')
-rw-r--r--afb-timer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/afb-timer.c b/afb-timer.c
index b302278..4afdb0e 100644
--- a/afb-timer.c
+++ b/afb-timer.c
@@ -61,8 +61,8 @@ static int TimerNext (sd_event_source* source, uint64_t timer, void* handle) {
}
void TimerEvtStop(TimerHandleT *timerHandle) {
-
sd_event_source_unref(timerHandle->evtSource);
+ if (timerHandle->freeCB) timerHandle->freeCB(timerHandle->context);
free (timerHandle);
}