diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs index f3b850d528..a7832568a2 100644 --- a/OpenSim/Framework/ILandObject.cs +++ b/OpenSim/Framework/ILandObject.cs @@ -189,5 +189,7 @@ namespace OpenSim.Framework /// /// The music url. string GetMusicUrl(); + + void Clear(); } } diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 6f32a770f4..057e204d59 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 ccb85f6c26..b534a2b0a9 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