From 22e216fd123744f6c87024fc18f3c9b306777fe2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 25 Oct 2012 22:55:29 +0100 Subject: 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 --- OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Tests') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs index d722a09..ac3da1e 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneTests.cs @@ -65,5 +65,22 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(scene.Frame, Is.EqualTo(1)); } + + [Test] + public void TestShutdownScene() + { + TestHelpers.InMethod(); + + Scene scene = new SceneHelpers().SetupScene(); + scene.Close(); + + Assert.That(scene.ShuttingDown, Is.True); + Assert.That(scene.Active, Is.False); + + // Trying to update a shutdown scene should result in no update + scene.Update(1); + + Assert.That(scene.Frame, Is.EqualTo(0)); + } } } \ No newline at end of file -- cgit v1.1