[Bf-blender-cvs] [9cc75bc] master: Fix T44945: Blender crashes when using multiple domains and multiple flow objects with subframes

Sergey Sharybin noreply at git.blender.org
Wed Aug 26 15:31:14 CEST 2015


Commit: 9cc75bc524bfc80ed992fc97070b4d70011a896a
Author: Sergey Sharybin
Date:   Wed Aug 26 15:27:22 2015 +0200
Branches: master
https://developer.blender.org/rB9cc75bc524bfc80ed992fc97070b4d70011a896a

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.

===================================================================

M	source/blender/blenkernel/intern/smoke.c

===================================================================

diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c
index 2637969..4e2f6ed 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 <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);




More information about the Bf-blender-cvs mailing list