From 38caf8b7b3bc0659e63f57ab65f38649ca413f8b Mon Sep 17 00:00:00 2001 From: AlonzoTG Date: Tue, 10 May 2016 12:46:58 -0400 Subject: [PATCH] Resource leak patch Addresses a potential resource leak to make sure containing class passes destroy command to external resource. --- .../Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs b/Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs index 553a6e4c5..5ab813e2c 100644 --- a/Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs +++ b/Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs @@ -1,13 +1,8 @@ - -using Sandbox.Common; -using Sandbox.Engine.Physics; -using System; +using System; using System.Collections.Generic; using System.Diagnostics; -using System.Threading; using VRage; using VRage.Collections; -using VRage; using VRage.Utils; using VRage.Voxels; using VRageMath; @@ -18,7 +13,7 @@ namespace Sandbox.Engine.Voxels { - public partial class MyVoxelGeometry + public partial class MyVoxelGeometry : IDisposable { private static List m_sweepResultCache = new List(); private static List m_overlapElementCache = new List(); @@ -446,5 +441,10 @@ private void SetEmpty(ref MyCellCoord cell, bool value) Debug.Assert(IsEmpty(ref cell) == value); } + + public void Dispose() + { + m_lock.Dispose(); + } } } \ No newline at end of file