clear land object on delete

httptests
UbitUmarov 2017-05-14 06:27:29 +01:00
parent 92df6095d5
commit 156707edfb
3 changed files with 19 additions and 1 deletions

View File

@ -189,5 +189,7 @@ namespace OpenSim.Framework
/// </summary>
/// <returns>The music url.</returns>
string GetMusicUrl();
void Clear();
}
}

View File

@ -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);
}

View File

@ -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<IDwellModule>();
}
@ -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