diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-09-12 15:44:33 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-09-12 15:44:33 +0300 |
commit | c6221f5ce42f5ef2e33ebf1b4dd745b87c70d129 (patch) | |
tree | 58fb02bde815e64350fb747315142eb1775c6b79 /source | |
parent | 369d5e8ad2bb7c249c6b941779066b6aa99f9ea0 (diff) |
BLI: fix unregistering timer with same id twice
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/BLI_timer.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/blenlib/intern/BLI_timer.c b/source/blender/blenlib/intern/BLI_timer.c index 7ff320083eb..0443dea9a2e 100644 --- a/source/blender/blenlib/intern/BLI_timer.c +++ b/source/blender/blenlib/intern/BLI_timer.c @@ -77,15 +77,10 @@ static void clear_user_data(TimedFunction *timed_func) bool BLI_timer_unregister(uintptr_t uuid) { LISTBASE_FOREACH (TimedFunction *, timed_func, &GlobalTimer.funcs) { - if (timed_func->uuid == uuid) { - if (timed_func->tag_removal) { - return false; - } - else { - timed_func->tag_removal = true; - clear_user_data(timed_func); - return true; - } + if (timed_func->uuid == uuid && !timed_func->tag_removal) { + timed_func->tag_removal = true; + clear_user_data(timed_func); + return true; } } return false; |