diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-17 07:02:34 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-17 07:02:34 +0200 |
commit | 51a46787f7e37a5b9afac4d895e117824d7fce38 (patch) | |
tree | dd39c39ffddac1f6c3b3ddb048f171e97b52caff | |
parent | ee6ccc61511812f92be85c694c5d6b5a00426004 (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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -159,7 +159,11 @@ struct Impl_Ticker { | |||
159 | 159 | ||
160 | static int cmp_Ticker_(const void *a, const void *b) { | 160 | static 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 | /*----------------------------------------------------------------------------------------------*/ |