Return everything at once, it's more efficient that way

avinationmerge
Tom Grimshaw 2010-06-26 13:07:17 -07:00
parent ed5dac7e82
commit d188ed8ed8
1 changed files with 6 additions and 1 deletions

View File

@ -2191,6 +2191,7 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void DeleteAllSceneObjects(bool exceptNoCopy) public void DeleteAllSceneObjects(bool exceptNoCopy)
{ {
List<SceneObjectGroup> toReturn = new List<SceneObjectGroup>();
lock (Entities) lock (Entities)
{ {
ICollection<EntityBase> entities = new List<EntityBase>(Entities); ICollection<EntityBase> entities = new List<EntityBase>(Entities);
@ -2208,12 +2209,16 @@ namespace OpenSim.Region.Framework.Scenes
} }
else else
{ {
DeRezObject(null, sog.RootPart.LocalId, sog.RootPart.GroupID, DeRezAction.Return, UUID.Zero); toReturn.Add((SceneObjectGroup)e);
} }
} }
} }
} }
} }
if (toReturn.Count > 0)
{
returnObjects(toReturn.ToArray(), UUID.Zero);
}
} }
/// <summary> /// <summary>