all repos — tint2 @ 7cd5c16fca6e29f3fccae57a6d118a27c9d589ee

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Fix crash when calling stop_timeout from the callback of a repeated timer
o9000 o9000
commit

7cd5c16fca6e29f3fccae57a6d118a27c9d589ee

parent

290ddc1feab91ba6bbc2eba78c698f2b3ba2b33a

1 files changed, 9 insertions(+), 2 deletions(-)

jump to
M src/util/timer.csrc/util/timer.c

@@ -389,12 +389,19 @@ multi_timeout_handler* mth = arg;

struct timespec cur_time; clock_gettime(CLOCK_MONOTONIC, &cur_time); GSList* it = mth->timeout_list; +start: while (it) { timeout* t = it->data; if (++t->multi_timeout->current_count >= t->multi_timeout->count_to_expiration) { t->_callback(t->arg); - t->multi_timeout->current_count = 0; - t->timeout_expires = add_msec_to_timespec(cur_time, t->interval_msec); + if (multi_timeouts && g_hash_table_lookup(multi_timeouts, t)) { + // Timer still exists + t->multi_timeout->current_count = 0; + t->timeout_expires = add_msec_to_timespec(cur_time, t->interval_msec); + } else { + it = mth->timeout_list; + goto start; + } } it = it->next; }