From 51a46787f7e37a5b9afac4d895e117824d7fce38 Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 17 Dec 2021 07:02:34 +0200 Subject: App: Fixed ticker management issue Multiple tickers with the same context would override each other. The ticker callback must be considered as well or tickers may fail to run as expected. --- src/app.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.c b/src/app.c index 68b17ade..86ef8b73 100644 --- a/src/app.c +++ b/src/app.c @@ -159,7 +159,11 @@ struct Impl_Ticker { static int cmp_Ticker_(const void *a, const void *b) { const iTicker *elems[2] = { a, b }; - return iCmp(elems[0]->context, elems[1]->context); + const int cmp = iCmp(elems[0]->context, elems[1]->context); + if (cmp) { + return cmp; + } + return iCmp((void *) elems[0]->callback, (void *) elems[1]->callback); } /*----------------------------------------------------------------------------------------------*/ -- cgit v1.2.3