aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-10-25 22:55:29 +0100
committerJustin Clark-Casey (justincc)2012-10-25 22:55:29 +0100
commit22e216fd123744f6c87024fc18f3c9b306777fe2 (patch)
tree5531c337a371e292a65ab2830cd7b5230165ffdc /OpenSim/Region/Framework/Scenes/Scene.cs
parentFix script error messages not showing up in viewer 3 and associated viewers. (diff)
downloadopensim-SC-22e216fd123744f6c87024fc18f3c9b306777fe2.zip
opensim-SC-22e216fd123744f6c87024fc18f3c9b306777fe2.tar.gz
opensim-SC-22e216fd123744f6c87024fc18f3c9b306777fe2.tar.bz2
opensim-SC-22e216fd123744f6c87024fc18f3c9b306777fe2.tar.xz
In Scene.Close(), dispose of the physics scene after base.Close() since script events can still access Physics scene until the script engine shuts down (triggered off base.Close())
XEngine listeners to EventManager.OnShutdown which is triggered from base.Close(). Possibly it could listen for the earlier OnSceneShuttingDown instead, but the easier solution right now is to relocate disposal of the physics scene. This bug has existed since c150320 (Thu Jul 26 15:27:18 2012) and was in 0.7.4
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 532598a..d48dc11 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1310,6 +1310,14 @@ namespace OpenSim.Region.Framework.Scenes
1310 1310
1311 m_sceneGraph.Close(); 1311 m_sceneGraph.Close();
1312 1312
1313 if (!GridService.DeregisterRegion(RegionInfo.RegionID))
1314 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name);
1315
1316 base.Close();
1317
1318 // XEngine currently listens to the EventManager.OnShutdown event to trigger script stop and persistence.
1319 // Therefore. we must dispose of the PhysicsScene after this to prevent a window where script code can
1320 // attempt to reference a null or disposed physics scene.
1313 if (PhysicsScene != null) 1321 if (PhysicsScene != null)
1314 { 1322 {
1315 PhysicsScene phys = PhysicsScene; 1323 PhysicsScene phys = PhysicsScene;
@@ -1318,12 +1326,6 @@ namespace OpenSim.Region.Framework.Scenes
1318 phys.Dispose(); 1326 phys.Dispose();
1319 phys = null; 1327 phys = null;
1320 } 1328 }
1321
1322 if (!GridService.DeregisterRegion(RegionInfo.RegionID))
1323 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", Name);
1324
1325 // call the base class Close method.
1326 base.Close();
1327 } 1329 }
1328 1330
1329 /// <summary> 1331 /// <summary>