summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-12-17 07:02:34 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-12-17 07:02:34 +0200
commit51a46787f7e37a5b9afac4d895e117824d7fce38 (patch)
treedd39c39ffddac1f6c3b3ddb048f171e97b52caff
parentee6ccc61511812f92be85c694c5d6b5a00426004 (diff)
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.
-rw-r--r--src/app.c6
1 files changed, 5 insertions, 1 deletions
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 {
159 159
160static int cmp_Ticker_(const void *a, const void *b) { 160static int cmp_Ticker_(const void *a, const void *b) {
161 const iTicker *elems[2] = { a, b }; 161 const iTicker *elems[2] = { a, b };
162 return iCmp(elems[0]->context, elems[1]->context); 162 const int cmp = iCmp(elems[0]->context, elems[1]->context);
163 if (cmp) {
164 return cmp;
165 }
166 return iCmp((void *) elems[0]->callback, (void *) elems[1]->callback);
163} 167}
164 168
165/*----------------------------------------------------------------------------------------------*/ 169/*----------------------------------------------------------------------------------------------*/