diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index abc7377730..bbac9191c2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2191,6 +2191,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void DeleteAllSceneObjects(bool exceptNoCopy) { + List toReturn = new List(); lock (Entities) { ICollection entities = new List(Entities); @@ -2208,12 +2209,16 @@ namespace OpenSim.Region.Framework.Scenes } 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); + } } ///