diff options
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index ae949a8b039..2c30a6f9c7e 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -42,6 +42,8 @@ #include <math.h> #include <float.h> +#include "atomic_ops.h" + #include "MEM_guardedalloc.h" #include "DNA_mesh_types.h" @@ -4251,7 +4253,8 @@ static void ccgDM_recalcLoopTri(DerivedMesh *dm) } BLI_assert(dm->looptris.array == NULL); - SWAP(MLoopTri *, dm->looptris.array, dm->looptris.array_wip); + atomic_cas_ptr((void **)&dm->looptris.array, dm->looptris.array, dm->looptris.array_wip); + dm->looptris.array_wip = NULL; } static void ccgDM_calcNormals(DerivedMesh *dm) |