* Added PhysicsScene.Dispose()
* In ODE, disposing of all of the ODE objects and the ODE World to reclaim memory when the simulator restarts.ThreadPoolClientBranch
parent
7647239f32
commit
f603e57e9a
|
@ -472,6 +472,11 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// This causes the region to restart immediatley.
|
||||
public void RestartNow()
|
||||
{
|
||||
if (PhysicsScene != null)
|
||||
{
|
||||
PhysicsScene.Dispose();
|
||||
}
|
||||
|
||||
m_log.Error("[REGION]: Closing");
|
||||
Close();
|
||||
m_log.Error("[REGION]: Firing Region Restart Message");
|
||||
|
|
|
@ -69,12 +69,16 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
|
|||
public BasicScene()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public override void Initialise(IMesher meshmerizer)
|
||||
{
|
||||
// Does nothing right now
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
|
||||
{
|
||||
BasicActor act = new BasicActor();
|
||||
|
|
|
@ -409,7 +409,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin
|
|||
mesher = meshmerizer;
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
|
||||
{
|
||||
PhysicsVector pos = new PhysicsVector();
|
||||
|
|
|
@ -81,6 +81,8 @@ namespace OpenSim.Region.Physics.Manager
|
|||
|
||||
public abstract void DeleteTerrain();
|
||||
|
||||
public abstract void Dispose();
|
||||
|
||||
public abstract bool IsThreaded { get; }
|
||||
|
||||
private class NullPhysicsScene : PhysicsScene
|
||||
|
@ -157,6 +159,10 @@ namespace OpenSim.Region.Physics.Manager
|
|||
{
|
||||
get { return false; }
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,10 @@ namespace OpenSim.Region.Physics.POSPlugin
|
|||
{
|
||||
// Does nothing right now
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
|
||||
{
|
||||
POSCharacter act = new POSCharacter();
|
||||
|
|
|
@ -88,7 +88,10 @@ namespace OpenSim.Region.Physics.PhysXPlugin
|
|||
{
|
||||
// Does nothing right now
|
||||
}
|
||||
public override void Dispose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue