forked from bartvdbraak/blender
Fix T40111: replaceMesh() crashes BGE when used on a parented object
The replace mesh code was still calling release() on the parent object when it no longer needed to (due to earlier commits).
This commit is contained in:
parent
aebcb3bab9
commit
43f3e79cee
@ -1166,8 +1166,6 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
|
|||||||
#ifdef WITH_BULLET
|
#ifdef WITH_BULLET
|
||||||
bool bHasSoftBody = (!parentobj && (blendobj->gameflag & OB_SOFT_BODY));
|
bool bHasSoftBody = (!parentobj && (blendobj->gameflag & OB_SOFT_BODY));
|
||||||
#endif
|
#endif
|
||||||
bool releaseParent = true;
|
|
||||||
|
|
||||||
|
|
||||||
if (oldblendobj==NULL) {
|
if (oldblendobj==NULL) {
|
||||||
if (bHasModifier || bHasShapeKey || bHasDvert || bHasArmature) {
|
if (bHasModifier || bHasShapeKey || bHasDvert || bHasArmature) {
|
||||||
@ -1189,7 +1187,6 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
|
|||||||
true,
|
true,
|
||||||
static_cast<BL_ArmatureObject*>( parentobj )
|
static_cast<BL_ArmatureObject*>( parentobj )
|
||||||
);
|
);
|
||||||
releaseParent= false;
|
|
||||||
modifierDeformer->LoadShapeDrivers(parentobj);
|
modifierDeformer->LoadShapeDrivers(parentobj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1217,7 +1214,6 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
|
|||||||
true,
|
true,
|
||||||
static_cast<BL_ArmatureObject*>( parentobj )
|
static_cast<BL_ArmatureObject*>( parentobj )
|
||||||
);
|
);
|
||||||
releaseParent= false;
|
|
||||||
shapeDeformer->LoadShapeDrivers(parentobj);
|
shapeDeformer->LoadShapeDrivers(parentobj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1243,7 +1239,6 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
|
|||||||
true,
|
true,
|
||||||
static_cast<BL_ArmatureObject*>( parentobj )
|
static_cast<BL_ArmatureObject*>( parentobj )
|
||||||
);
|
);
|
||||||
releaseParent= false;
|
|
||||||
newobj->SetDeformer(skinDeformer);
|
newobj->SetDeformer(skinDeformer);
|
||||||
}
|
}
|
||||||
else if (bHasDvert)
|
else if (bHasDvert)
|
||||||
@ -1260,10 +1255,6 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u
|
|||||||
newobj->SetDeformer(softdeformer);
|
newobj->SetDeformer(softdeformer);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// release parent reference if its not being used
|
|
||||||
if ( releaseParent && parentobj)
|
|
||||||
parentobj->Release();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user