mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
BulletSim: add a lock to try and catch a native shape creation/destruction
race condition.
This commit is contained in:
@@ -283,8 +283,13 @@ public class BSShapeNative : BSShape
|
||||
public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim)
|
||||
{
|
||||
// Native shapes are not shared so we return a new shape.
|
||||
return new BSShapeNative(CreatePhysicalNativeShape(pPhysicsScene, pPrim,
|
||||
physShapeInfo.shapeType, (FixedShapeKey)physShapeInfo.shapeKey) );
|
||||
BSShape ret = null;
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user