Fix T76858: non-thread safe sculpt memory allocation when using --debug-memory

By default the guarded memory allocator is not thread safe, that needs to be
initialized.
This commit is contained in:
Brecht Van Lommel 2020-05-20 00:31:21 +02:00
parent 59cfb20fa1
commit 499c0229f7
Notes: blender-bot 2023-02-14 10:18:56 +01:00
Referenced by issue #76858, Threading issue in sculpt mode
1 changed files with 3 additions and 0 deletions

View File

@ -121,6 +121,8 @@ void BKE_pbvh_parallel_range(const int start,
#ifdef WITH_TBB
/* Multithreading. */
if (settings->use_threading) {
BLI_threaded_malloc_begin();
PBVHTask task(func, userdata, settings);
if (settings->func_reduce) {
@ -133,6 +135,7 @@ void BKE_pbvh_parallel_range(const int start,
parallel_for(tbb::blocked_range<int>(start, stop), task);
}
BLI_threaded_malloc_end();
return;
}
#endif