BulletSim: add a lock to try and catch a native shape creation/destruction
race condition.0.7.5-pf-bulletsim
parent
783e8e4bab
commit
5b3e7156a3
|
@ -283,8 +283,13 @@ public class BSShapeNative : BSShape
|
||||||
public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
|
public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
|
||||||
{
|
{
|
||||||
// Native shapes are not shared so we return a new shape.
|
// Native shapes are not shared so we return a new shape.
|
||||||
return new BSShapeNative(CreatePhysicalNativeShape(pPhysicsScene, pPrim,
|
BSShape ret = null;
|
||||||
physShapeInfo.shapeType, (FixedShapeKey)physShapeInfo.shapeKey) );
|
lock (physShapeInfo)
|
||||||
|
{
|
||||||
|
ret = new BSShapeNative(CreatePhysicalNativeShape(pPhysicsScene, pPrim,
|
||||||
|
physShapeInfo.shapeType, (FixedShapeKey)physShapeInfo.shapeKey));
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make this reference to the physical shape go away since native shapes are not shared.
|
// Make this reference to the physical shape go away since native shapes are not shared.
|
||||||
|
|
Loading…
Reference in New Issue