remove some SOG references on delete to help GC

LSLKeyTest
UbitUmarov 2015-12-10 14:00:43 +00:00
parent bdab95f1d2
commit 62009ba9c0
3 changed files with 23 additions and 3 deletions

View File

@ -1083,6 +1083,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// Now, remove the scripts // Now, remove the scripts
so.RemoveScriptInstances(true); so.RemoveScriptInstances(true);
so.Clear();
} }
protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal( protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(

View File

@ -1577,6 +1577,7 @@ namespace OpenSim.Region.Framework.Scenes
m_heartbeatThread = null; m_heartbeatThread = null;
} }
GC.Collect();
// tell physics to finish building actor // tell physics to finish building actor
m_sceneGraph.ProcessPhysicsPreSimulation(); m_sceneGraph.ProcessPhysicsPreSimulation();
@ -2798,6 +2799,10 @@ namespace OpenSim.Region.Framework.Scenes
if (!silent) if (!silent)
SendKillObject(new List<uint>() { group.LocalId }); SendKillObject(new List<uint>() { group.LocalId });
// use this to mean also full delete
if (removeScripts)
group.Clear();
partList = null;
// m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID);
} }

View File

@ -764,6 +764,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
avsToCross.Clear(); avsToCross.Clear();
sog.RemoveScriptInstances(true); sog.RemoveScriptInstances(true);
sog.Clear();
return sog; return sog;
} }
else // cross failed, put avas back ?? else // cross failed, put avas back ??
@ -2245,7 +2246,6 @@ namespace OpenSim.Region.Framework.Scenes
{ {
part.Inventory.ProcessInventoryBackup(datastore); part.Inventory.ProcessInventoryBackup(datastore);
// take the change to delete things
if(part.KeyframeMotion != null) if(part.KeyframeMotion != null)
{ {
part.KeyframeMotion.Delete(); part.KeyframeMotion.Delete();
@ -2253,7 +2253,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
}); });
backup_group.Clear();
backup_group = null; backup_group = null;
} }
// else // else
@ -4846,6 +4846,20 @@ namespace OpenSim.Region.Framework.Scenes
}); });
} }
// clear some references to easy cg
public void Clear()
{
m_parts.Clear();
m_sittingAvatars.Clear();
m_rootPart = null;
m_PlaySoundMasterPrim = null;
m_PlaySoundSlavePrims.Clear();
m_LoopSoundMasterPrim = null;
m_targets.Clear();
}
#endregion #endregion
} }
} }