From 9cc75bc524bfc80ed992fc97070b4d70011a896a Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 26 Aug 2015 15:27:22 +0200 Subject: [PATCH] Fix T44945: Blender crashes when using multiple domains and multiple flow objects with subframes This is more like a workaround to prevent obvious cases fail, but in theory if some other area will start updating object for subframes blender will crash again. Perhaps proper way to solve this will be to copy objects for subframe updates. --- source/blender/blenkernel/intern/smoke.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 2637969682d..4e2f6edfcdd 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -93,6 +93,8 @@ #ifdef WITH_SMOKE +static ThreadMutex object_update_lock = BLI_MUTEX_INITIALIZER; + #ifdef _WIN32 #include #include @@ -2164,7 +2166,9 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd } else { /* MOD_SMOKE_FLOW_SOURCE_MESH */ /* update flow object frame */ + BLI_mutex_lock(&object_update_lock); subframe_updateObject(scene, collob, 1, 5, BKE_scene_frame_get(scene), for_render); + BLI_mutex_unlock(&object_update_lock); /* apply flow */ emit_from_derivedmesh(collob, sds, sfs, &em_temp, sdt);