Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <mail@jlucke.com>2019-09-12 15:44:33 +0300
committerJacques Lucke <mail@jlucke.com>2019-09-12 15:44:33 +0300
commitc6221f5ce42f5ef2e33ebf1b4dd745b87c70d129 (patch)
tree58fb02bde815e64350fb747315142eb1775c6b79 /source/blender/blenlib/intern/BLI_timer.c
parent369d5e8ad2bb7c249c6b941779066b6aa99f9ea0 (diff)
BLI: fix unregistering timer with same id twice
Diffstat (limited to 'source/blender/blenlib/intern/BLI_timer.c')
-rw-r--r--source/blender/blenlib/intern/BLI_timer.c13
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;