BLI: fix unregistering timer with same id twice

This commit is contained in:
Jacques Lucke 2019-09-12 14:44:33 +02:00
parent 369d5e8ad2
commit c6221f5ce4
1 changed files with 4 additions and 9 deletions

View File

@ -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;