mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
make sog, sop and sop inventory IDisposable
This commit is contained in:
@@ -93,7 +93,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
#endregion Enumerations
|
||||
|
||||
public class SceneObjectPart : ISceneEntity
|
||||
public class SceneObjectPart : ISceneEntity, IDisposable
|
||||
{
|
||||
/// <value>
|
||||
/// Denote all sides of the prim
|
||||
@@ -454,6 +454,40 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
AggregateInnerPerms();
|
||||
}
|
||||
|
||||
~SceneObjectPart()
|
||||
{
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
private bool disposed = false;
|
||||
public void Dispose()
|
||||
{
|
||||
Dispose(true);
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
|
||||
protected void Dispose(bool disposing)
|
||||
{
|
||||
// Check to see if Dispose has already been called.
|
||||
if (!disposed)
|
||||
{
|
||||
if (KeyframeMotion != null)
|
||||
{
|
||||
KeyframeMotion.Delete();
|
||||
KeyframeMotion = null;
|
||||
}
|
||||
if (PhysActor != null)
|
||||
RemoveFromPhysics();
|
||||
|
||||
if (m_inventory != null)
|
||||
{
|
||||
m_inventory.Dispose();
|
||||
m_inventory = null;
|
||||
}
|
||||
disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region XML Schema
|
||||
|
||||
Reference in New Issue
Block a user