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.
This commit is contained in:
Sergey Sharybin 2015-08-26 15:27:22 +02:00
parent 3e4a7f4366
commit 9cc75bc524
Notes: blender-bot 2023-05-29 09:17:12 +02:00
Referenced by issue #44945, Blender crashes when using multiple domains and multiple flow objects with subframes
1 changed files with 4 additions and 0 deletions

View File

@ -93,6 +93,8 @@
#ifdef WITH_SMOKE
static ThreadMutex object_update_lock = BLI_MUTEX_INITIALIZER;
#ifdef _WIN32
#include <time.h>
#include <stdio.h>
@ -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);