From f603e57e9ae9d9b7e3bf6b35924d99292cf6de43 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Mon, 11 Feb 2008 22:54:51 +0000 Subject: * Added PhysicsScene.Dispose() * In ODE, disposing of all of the ODE objects and the ODE World to reclaim memory when the simulator restarts. --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region/Physics/OdePlugin') diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 2b3d186..e58984b 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -73,6 +73,8 @@ namespace OpenSim.Region.Physics.OdePlugin public void Dispose() { + + d.CloseODE(); } } @@ -1509,5 +1511,23 @@ namespace OpenSim.Region.Physics.OdePlugin public override void DeleteTerrain() { } + public override void Dispose() + { + lock (OdeLock) + { + + foreach (OdePrim prm in _prims) + { + RemovePrim(prm); + } + + foreach (OdeCharacter act in _characters) + { + RemoveAvatar(act); + } + d.WorldDestroy(world); + //d.CloseODE(); + } + } } } -- cgit v1.1