diff options
author | Robert Adams | 2013-05-13 13:05:27 -0700 |
---|---|---|
committer | Robert Adams | 2013-05-14 18:45:06 -0700 |
commit | 5b3e7156a34b5702d32419ff0ff92e83560d0dba (patch) | |
tree | 6f81e7f54d33fbe470f3145ee5a9f7fafb89b76c /OpenSim/Region | |
parent | BulletSim: add adjustment for avatar capsule height scaling. Makes (diff) | |
download | opensim-SC_OLD-5b3e7156a34b5702d32419ff0ff92e83560d0dba.zip opensim-SC_OLD-5b3e7156a34b5702d32419ff0ff92e83560d0dba.tar.gz opensim-SC_OLD-5b3e7156a34b5702d32419ff0ff92e83560d0dba.tar.bz2 opensim-SC_OLD-5b3e7156a34b5702d32419ff0ff92e83560d0dba.tar.xz |
BulletSim: add a lock to try and catch a native shape creation/destruction
race condition.
Diffstat (limited to 'OpenSim/Region')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs index 262d734..72d039b 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs | |||
@@ -283,8 +283,13 @@ public class BSShapeNative : BSShape | |||
283 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) | 283 | public override BSShape GetReference(BSScene pPhysicsScene, BSPhysObject pPrim) |
284 | { | 284 | { |
285 | // Native shapes are not shared so we return a new shape. | 285 | // Native shapes are not shared so we return a new shape. |
286 | return new BSShapeNative(CreatePhysicalNativeShape(pPhysicsScene, pPrim, | 286 | BSShape ret = null; |
287 | physShapeInfo.shapeType, (FixedShapeKey)physShapeInfo.shapeKey) ); | 287 | lock (physShapeInfo) |
288 | { | ||
289 | ret = new BSShapeNative(CreatePhysicalNativeShape(pPhysicsScene, pPrim, | ||
290 | physShapeInfo.shapeType, (FixedShapeKey)physShapeInfo.shapeKey)); | ||
291 | } | ||
292 | return ret; | ||
288 | } | 293 | } |
289 | 294 | ||
290 | // Make this reference to the physical shape go away since native shapes are not shared. | 295 | // Make this reference to the physical shape go away since native shapes are not shared. |