From: Romain Forlot Date: Fri, 4 Jan 2019 13:25:55 +0000 (+0100) Subject: Call the freeCB function a manual timer stop call X-Git-Tag: 6.99.4~1 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=2e36a74fa8ae2a4b8e06f7752c3876f32a8dcbb3;p=src%2Flibafb-helpers.git 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 --- 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); }