From 59cfb20fa112e636a6ae85cb6fdc048f16af5637 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 19 May 2020 22:44:51 +0200 Subject: [PATCH] Fix PBVH parallel range not initializing user data correctly in some cases This was already changed for the TBB-based BLI_task_parallel_range in master. This task local storage should always be initialized from the template, not copied from another task which may be executing at the time the copy happens. This may not fix any actual bug, we only use this user data for parallel reduce and it's not clear that TBB ever calls the copy constructor for that case. Ref T76858 --- source/blender/blenkernel/intern/pbvh_parallel.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/pbvh_parallel.cc b/source/blender/blenkernel/intern/pbvh_parallel.cc index 2534fdea3ee..adacbd13b61 100644 --- a/source/blender/blenkernel/intern/pbvh_parallel.cc +++ b/source/blender/blenkernel/intern/pbvh_parallel.cc @@ -49,7 +49,7 @@ struct PBVHTask { PBVHTask(const PBVHTask &other) : func(other.func), userdata(other.userdata), settings(other.settings) { - init_chunk(other.userdata_chunk); + init_chunk(settings->userdata_chunk); } /* Splitting constructor for parallel reduce. */