diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs index 933fa12bc2..2bb0926bb6 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs @@ -330,5 +330,16 @@ namespace OpenSim.Framework.Communications.Tests Assert.That(rootFolder.RequestListOfFolders(), Is.Empty); Assert.That(myScene.InventoryService.GetFolder(myFolder), Is.Null); } + + [TearDown] + public void TearDown() + { + try + { + if (MainServer.Instance != null) MainServer.Instance.Stop(); + } + catch (System.NullReferenceException) + { } + } } } \ No newline at end of file diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index 57a908e128..0a9d2aebba 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs @@ -362,6 +362,16 @@ namespace OpenSim.Framework.Communications.Tests //Console.WriteLine("Finished T023_TestAuthenticatedLoginAlreadyLoggedIn()"); } + [TearDown] + public void TearDown() + { + try + { + if (MainServer.Instance != null) MainServer.Instance.Stop(); + } catch (NullReferenceException) + {} + } + public class TestLoginToRegionConnector : ILoginServiceToRegionsConnector { private List m_regionsList = new List(); diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 75c9310de0..771ae05437 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -1637,13 +1637,20 @@ namespace OpenSim.Framework.Servers.HttpServer public void Stop() { HTTPDRunning = false; - m_httpListener2.ExceptionThrown -= httpServerException; - //m_httpListener2.DisconnectHandler = null; - - m_httpListener2.LogWriter = null; - m_httpListener2.RequestReceived -= OnRequest; + try + { + m_httpListener2.ExceptionThrown -= httpServerException; + //m_httpListener2.DisconnectHandler = null; - m_httpListener2.Stop(); + m_httpListener2.LogWriter = null; + m_httpListener2.RequestReceived -= OnRequest; + m_httpListener2.Stop(); + } + catch (NullReferenceException) + { + m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer."); + } + } public void RemoveStreamHandler(string httpMethod, string path) diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 3ee60072a3..8cd1d554b4 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs @@ -378,6 +378,12 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(presence.HasAttachments(), Is.True, "Presence has not received new objects"); } + [TearDown] + public void TearDown() + { + if (MainServer.Instance != null) MainServer.Instance.Stop(); + } + public static string GetRandomCapsObjectPath() { TestHelper.InMethod(); diff --git a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs index 23eab9010c..1d460dd2ec 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/StandaloneTeleportTests.cs @@ -78,6 +78,17 @@ namespace OpenSim.Region.Framework.Scenes.Tests // Console.WriteLine("Beginning test {0}", MethodBase.GetCurrentMethod()); } + [TearDown] + public void TearDown() + { + try + { + if (MainServer.Instance != null) MainServer.Instance.Stop(); + } + catch (NullReferenceException) + { } + } + } public class ThreadRunResults diff --git a/prebuild.xml b/prebuild.xml index 4dbb81c96a..343b06a166 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -3181,6 +3181,7 @@ + @@ -3245,7 +3246,7 @@ ../../../bin/ - + @@ -3254,7 +3255,7 @@ - + @@ -3397,6 +3398,7 @@ + @@ -3488,6 +3490,7 @@ + @@ -3524,6 +3527,7 @@ + @@ -3585,6 +3589,7 @@ +