[Bf-blender-cvs] [7317b4f] master: Fix 40343: Using replace mesh (e.g., LODs) on a skinned mesh crashes.

Mitchell Stokes noreply at git.blender.org
Wed May 28 02:07:00 CEST 2014


Commit: 7317b4fcf10edb367b48c32bd8d44ee1902148fe
Author: Mitchell Stokes
Date:   Tue May 27 17:05:35 2014 -0700
https://developer.blender.org/rB7317b4fcf10edb367b48c32bd8d44ee1902148fe

Fix 40343: Using replace mesh (e.g., LODs) on a skinned mesh crashes.

Need to use parent->AddRef() in a few places.

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

M	source/gameengine/Ketsji/KX_Scene.cpp

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

diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 4d2a842..d06b9a0 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -1185,7 +1185,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
 						oldblendobj, blendobj,
 						mesh,
 						true,
-						static_cast<BL_ArmatureObject*>( parentobj )
+						static_cast<BL_ArmatureObject*>( parentobj->AddRef() )
 					);
 					modifierDeformer->LoadShapeDrivers(parentobj);
 				}
@@ -1212,7 +1212,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
 						mesh,
 						true,
 						true,
-						static_cast<BL_ArmatureObject*>( parentobj )
+						static_cast<BL_ArmatureObject*>( parentobj->AddRef() )
 					);
 					shapeDeformer->LoadShapeDrivers(parentobj);
 				}
@@ -1237,7 +1237,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
 					mesh,
 					true,
 					true,
-					static_cast<BL_ArmatureObject*>( parentobj )
+					static_cast<BL_ArmatureObject*>( parentobj->AddRef() )
 				);
 				newobj->SetDeformer(skinDeformer);
 			}




More information about the Bf-blender-cvs mailing list