mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 11:33:28 +08:00
make sog, sop and sop inventory IDisposable
This commit is contained in:
@@ -43,7 +43,7 @@ using PermissionMask = OpenSim.Framework.PermissionMask;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
public class SceneObjectPartInventory : IEntityInventory
|
||||
public class SceneObjectPartInventory : IEntityInventory , IDisposable
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
@@ -125,6 +125,32 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_part = part;
|
||||
}
|
||||
|
||||
~SceneObjectPartInventory()
|
||||
{
|
||||
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 (m_items != null)
|
||||
{
|
||||
m_items.Dispose();
|
||||
m_items = null;
|
||||
}
|
||||
disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Force the task inventory of this prim to persist at the next update sweep
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user