diff options
author | Robert Adams | 2012-07-23 13:48:40 -0700 |
---|---|---|
committer | Robert Adams | 2012-07-23 16:32:36 -0700 |
commit | 8a574395c7626f0aef596cbb928e0b4139ebab12 (patch) | |
tree | a6a325172ecec7f6a94322ab51d6fa6d366382b0 /OpenSim/Region/Physics | |
parent | BulletSim: add all the new functions to BulletSimAPI. (diff) | |
download | opensim-SC_OLD-8a574395c7626f0aef596cbb928e0b4139ebab12.zip opensim-SC_OLD-8a574395c7626f0aef596cbb928e0b4139ebab12.tar.gz opensim-SC_OLD-8a574395c7626f0aef596cbb928e0b4139ebab12.tar.bz2 opensim-SC_OLD-8a574395c7626f0aef596cbb928e0b4139ebab12.tar.xz |
BulletSim: add Dispose() code to free up resources and close log files.
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 8773485..7cc3fe3 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -630,6 +630,27 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
630 | public override void Dispose() | 630 | public override void Dispose() |
631 | { | 631 | { |
632 | // m_log.DebugFormat("{0}: Dispose()", LogHeader); | 632 | // m_log.DebugFormat("{0}: Dispose()", LogHeader); |
633 | |||
634 | // make sure no stepping happens while we're deleting stuff | ||
635 | m_initialized = false; | ||
636 | |||
637 | foreach (KeyValuePair<uint, BSCharacter> kvp in m_avatars) | ||
638 | { | ||
639 | kvp.Value.Destroy(); | ||
640 | } | ||
641 | m_avatars.Clear(); | ||
642 | |||
643 | foreach (KeyValuePair<uint, BSPrim> kvp in m_prims) | ||
644 | { | ||
645 | kvp.Value.Destroy(); | ||
646 | } | ||
647 | m_prims.Clear(); | ||
648 | |||
649 | // Anything left in the unmanaged code should be cleaned out | ||
650 | BulletSimAPI.Shutdown(WorldID); | ||
651 | |||
652 | // Not logging any more | ||
653 | PhysicsLogging.Close(); | ||
633 | } | 654 | } |
634 | 655 | ||
635 | public override Dictionary<uint, float> GetTopColliders() | 656 | public override Dictionary<uint, float> GetTopColliders() |