make sog, sop and sop inventory IDisposable

This commit is contained in:
UbitUmarov
2020-05-14 12:02:46 +01:00
parent dd55a3d19c
commit 8b77162020
5 changed files with 104 additions and 19 deletions

View File

@@ -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>