diff options
author | Teravus Ovares | 2008-02-11 22:54:51 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-11 22:54:51 +0000 |
commit | f603e57e9ae9d9b7e3bf6b35924d99292cf6de43 (patch) | |
tree | 5b3395faf6d8d9c46006f4d7fdb2ddfe36bd8be6 /OpenSim | |
parent | Tiny change to print out a warning in a situation which almost guaranteeably ... (diff) | |
download | opensim-SC-f603e57e9ae9d9b7e3bf6b35924d99292cf6de43.zip opensim-SC-f603e57e9ae9d9b7e3bf6b35924d99292cf6de43.tar.gz opensim-SC-f603e57e9ae9d9b7e3bf6b35924d99292cf6de43.tar.bz2 opensim-SC-f603e57e9ae9d9b7e3bf6b35924d99292cf6de43.tar.xz |
* Added PhysicsScene.Dispose()
* In ODE, disposing of all of the ODE objects and the ODE World to reclaim memory when the simulator restarts.
Diffstat (limited to 'OpenSim')
7 files changed, 45 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 88cda40..6b4f377 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -472,6 +472,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
472 | // This causes the region to restart immediatley. | 472 | // This causes the region to restart immediatley. |
473 | public void RestartNow() | 473 | public void RestartNow() |
474 | { | 474 | { |
475 | if (PhysicsScene != null) | ||
476 | { | ||
477 | PhysicsScene.Dispose(); | ||
478 | } | ||
479 | |||
475 | m_log.Error("[REGION]: Closing"); | 480 | m_log.Error("[REGION]: Closing"); |
476 | Close(); | 481 | Close(); |
477 | m_log.Error("[REGION]: Firing Region Restart Message"); | 482 | m_log.Error("[REGION]: Firing Region Restart Message"); |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index ff157d7..13b3f1a 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -69,12 +69,16 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
69 | public BasicScene() | 69 | public BasicScene() |
70 | { | 70 | { |
71 | } | 71 | } |
72 | 72 | ||
73 | public override void Initialise(IMesher meshmerizer) | 73 | public override void Initialise(IMesher meshmerizer) |
74 | { | 74 | { |
75 | // Does nothing right now | 75 | // Does nothing right now |
76 | } | 76 | } |
77 | 77 | ||
78 | public override void Dispose() | ||
79 | { | ||
80 | |||
81 | } | ||
78 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) | 82 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) |
79 | { | 83 | { |
80 | BasicActor act = new BasicActor(); | 84 | BasicActor act = new BasicActor(); |
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index 27ae490..fb32f93 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |||
@@ -409,7 +409,10 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
409 | mesher = meshmerizer; | 409 | mesher = meshmerizer; |
410 | } | 410 | } |
411 | 411 | ||
412 | public override void Dispose() | ||
413 | { | ||
412 | 414 | ||
415 | } | ||
413 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) | 416 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) |
414 | { | 417 | { |
415 | PhysicsVector pos = new PhysicsVector(); | 418 | PhysicsVector pos = new PhysicsVector(); |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 00c0ff1..5f08898 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs | |||
@@ -81,6 +81,8 @@ namespace OpenSim.Region.Physics.Manager | |||
81 | 81 | ||
82 | public abstract void DeleteTerrain(); | 82 | public abstract void DeleteTerrain(); |
83 | 83 | ||
84 | public abstract void Dispose(); | ||
85 | |||
84 | public abstract bool IsThreaded { get; } | 86 | public abstract bool IsThreaded { get; } |
85 | 87 | ||
86 | private class NullPhysicsScene : PhysicsScene | 88 | private class NullPhysicsScene : PhysicsScene |
@@ -157,6 +159,10 @@ namespace OpenSim.Region.Physics.Manager | |||
157 | { | 159 | { |
158 | get { return false; } | 160 | get { return false; } |
159 | } | 161 | } |
162 | public override void Dispose() | ||
163 | { | ||
164 | |||
165 | } | ||
160 | } | 166 | } |
161 | } | 167 | } |
162 | } \ No newline at end of file | 168 | } \ No newline at end of file |
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 | |||
73 | 73 | ||
74 | public void Dispose() | 74 | public void Dispose() |
75 | { | 75 | { |
76 | |||
77 | d.CloseODE(); | ||
76 | } | 78 | } |
77 | } | 79 | } |
78 | 80 | ||
@@ -1509,5 +1511,23 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1509 | public override void DeleteTerrain() | 1511 | public override void DeleteTerrain() |
1510 | { | 1512 | { |
1511 | } | 1513 | } |
1514 | public override void Dispose() | ||
1515 | { | ||
1516 | lock (OdeLock) | ||
1517 | { | ||
1518 | |||
1519 | foreach (OdePrim prm in _prims) | ||
1520 | { | ||
1521 | RemovePrim(prm); | ||
1522 | } | ||
1523 | |||
1524 | foreach (OdeCharacter act in _characters) | ||
1525 | { | ||
1526 | RemoveAvatar(act); | ||
1527 | } | ||
1528 | d.WorldDestroy(world); | ||
1529 | //d.CloseODE(); | ||
1530 | } | ||
1531 | } | ||
1512 | } | 1532 | } |
1513 | } | 1533 | } |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs index 2b07553..079e66a 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs | |||
@@ -77,7 +77,10 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
77 | { | 77 | { |
78 | // Does nothing right now | 78 | // Does nothing right now |
79 | } | 79 | } |
80 | public override void Dispose() | ||
81 | { | ||
80 | 82 | ||
83 | } | ||
81 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) | 84 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) |
82 | { | 85 | { |
83 | POSCharacter act = new POSCharacter(); | 86 | POSCharacter act = new POSCharacter(); |
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index 71bd94e..509bdfa 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |||
@@ -88,7 +88,10 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
88 | { | 88 | { |
89 | // Does nothing right now | 89 | // Does nothing right now |
90 | } | 90 | } |
91 | public override void Dispose() | ||
92 | { | ||
91 | 93 | ||
94 | } | ||
92 | 95 | ||
93 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) | 96 | public override PhysicsActor AddAvatar(string avName, PhysicsVector position) |
94 | { | 97 | { |