From 156707edfb88b9ddf679751f8f6d8128b2abd7be Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 14 May 2017 06:27:29 +0100 Subject: clear land object on delete --- .../Region/CoreModules/World/Land/LandManagementModule.cs | 6 +++++- OpenSim/Region/CoreModules/World/Land/LandObject.cs | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 6f32a77..057e204 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -274,6 +274,9 @@ namespace OpenSim.Region.CoreModules.World.Land //Remove all the land objects in the sim and add a blank, full sim land object set to public lock (m_landList) { + foreach(ILandObject parcel in m_landList.Values) + parcel.Clear(); + m_landList.Clear(); m_landUUIDList.Clear(); m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1; @@ -696,6 +699,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_landList.Remove(local_id); if(land.LandData != null) m_landUUIDList.Remove(land.LandData.GlobalID); + land.Clear(); } m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); @@ -746,7 +750,7 @@ namespace OpenSim.Region.CoreModules.World.Land } } } - + master.LandData.Dwell += slave.LandData.Dwell; removeLandObject(slave.LandData.LocalID); UpdateLandObject(master.LandData.LocalID, master.LandData); } diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index ccb85f6..b534a2b 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -269,6 +269,7 @@ namespace OpenSim.Region.CoreModules.World.Land { LandData = landData.Copy(); m_scene = scene; + m_scene.EventManager.OnFrame += OnFrame; m_dwellModule = m_scene.RequestModuleInterface(); } @@ -296,9 +297,20 @@ namespace OpenSim.Region.CoreModules.World.Land LandData.IsGroupOwned = is_group_owned; + if(m_dwellModule == null) + LandData.Dwell = 0; + m_scene.EventManager.OnFrame += OnFrame; } + public void Clear() + { + if(m_scene != null) + m_scene.EventManager.OnFrame -= OnFrame; + LandData = null; + } + + #endregion #region Member Functions -- cgit v1.1