[Bf-blender-cvs] [c6221f5ce42] master: BLI: fix unregistering timer with same id twice
Jacques Lucke
noreply at git.blender.org
Thu Sep 12 14:46:48 CEST 2019
Commit: c6221f5ce42f5ef2e33ebf1b4dd745b87c70d129
Author: Jacques Lucke
Date: Thu Sep 12 14:44:33 2019 +0200
Branches: master
https://developer.blender.org/rBc6221f5ce42f5ef2e33ebf1b4dd745b87c70d129
BLI: fix unregistering timer with same id twice
===================================================================
M 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;
More information about the Bf-blender-cvs
mailing list