diff options
author | Robert Adams | 2013-05-13 13:05:27 -0700 |
---|---|---|
committer | Robert Adams | 2013-05-13 13:30:44 -0700 |
commit | c86e828dbfed8b9cf72c7e7e8d1dad0c0e9f8940 (patch) | |
tree | 58c200f5b70c22faaf4904164780a24b3e1708c4 /OpenSim/Region | |
parent | BulletSim: add adjustment for avatar capsule height scaling. Makes (diff) | |
download | opensim-SC_OLD-c86e828dbfed8b9cf72c7e7e8d1dad0c0e9f8940.zip opensim-SC_OLD-c86e828dbfed8b9cf72c7e7e8d1dad0c0e9f8940.tar.gz opensim-SC_OLD-c86e828dbfed8b9cf72c7e7e8d1dad0c0e9f8940.tar.bz2 opensim-SC_OLD-c86e828dbfed8b9cf72c7e7e8d1dad0c0e9f8940.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. |