From c6221f5ce42f5ef2e33ebf1b4dd745b87c70d129 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 12 Sep 2019 14:44:33 +0200 Subject: BLI: fix unregistering timer with same id twice --- source/blender/blenlib/intern/BLI_timer.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'source/blender/blenlib/intern/BLI_timer.c') 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; -- cgit v1.2.3