diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2019-06-05 00:20:22 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2019-06-05 00:51:03 +0300 |
commit | 30d9366d17328a5f15a32e537c0a2969ea82bd3f (patch) | |
tree | 6320bc0c26794955b589bc6987026b11d0e5a0c3 | |
parent | b640265f77632a1d4b58be24171eb3354cc44c97 (diff) |
Fix (unreported) Broken `BLI_threadapi_exit()`.
Function would not clear the static scheduler pointer, which lead to
crash (mem use after free) when trying to re-init and use the task API
again. Should not happen in Blender itself, but could in other cases
(like some future gtests ;) ).
-rw-r--r-- | source/blender/blenlib/intern/threads.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index abd59dac891..978dee319b4 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -161,6 +161,7 @@ void BLI_threadapi_exit(void) { if (task_scheduler) { BLI_task_scheduler_free(task_scheduler); + task_scheduler = NULL; } BLI_spin_end(&_malloc_lock); } |