diff --git a/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs b/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs index 4cc9f75bf8a66815f28baa47c4a8d5e373ece81c..9c8e0d45f996bc526a74a68e2fd9e4ea9b1cc4e9 100644 --- a/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs +++ b/VectoCore/VectoCore/Models/Simulation/Impl/JobContainer.cs @@ -187,7 +187,7 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl public string RunSuffix; } - internal class RunEntry : LoggingObject + internal class RunEntry : LoggingObject, IDisposable { public IVectoRun Run; public JobContainer JobContainer; @@ -244,6 +244,11 @@ namespace TUGraz.VectoCore.Models.Simulation.Impl ExecException = e.Error; } } + + public void Dispose() + { + _worker.Dispose(); + } } } } \ No newline at end of file diff --git a/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/FuelConsumptionMap.cs b/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/FuelConsumptionMap.cs index 4f6666dd6b8925254e5210c7850d17607fb4a904..0968285e11bf72a469a6af6c6b3780e35e097b99 100644 --- a/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/FuelConsumptionMap.cs +++ b/VectoCore/VectoCore/Models/SimulationComponent/Data/Engine/FuelConsumptionMap.cs @@ -40,11 +40,10 @@ using TUGraz.VectoCore.Utils; namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Engine { - public class FuelConsumptionMap : SimulationComponentData + public class FuelConsumptionMap : SimulationComponentData, IDisposable { [Required, ValidateObject] private readonly DelaunayMap _fuelMap = new DelaunayMap("FuelConsumptionMap"); - - + private FuelConsumptionMap() {} public static FuelConsumptionMap ReadFromFile(string fileName) @@ -228,6 +227,18 @@ namespace TUGraz.VectoCore.Models.SimulationComponent.Data.Engine return _fuelMap != null ? _fuelMap.GetHashCode() : 0; } + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + _fuelMap.Dispose(); + } + #endregion } } \ No newline at end of file diff --git a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs index eb4ce09495535c5ccf3d37a73fef6cee5eb9f342..6dd12d98eb28ec65bf0f00cf70090dd7d8c61b29 100644 --- a/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs +++ b/VectoCore/VectoCore/OutputData/SummaryDataContainer.cs @@ -29,6 +29,7 @@ * Martin Rexeis, rexeis@ivt.tugraz.at, IVT, Graz University of Technology */ +using System; using System.Data; using System.Linq; using System.Runtime.CompilerServices; @@ -42,7 +43,7 @@ namespace TUGraz.VectoCore.OutputData /// <summary> /// Class for the sum file in vecto. /// </summary> - public class SummaryDataContainer : LoggingObject + public class SummaryDataContainer : LoggingObject, IDisposable { // ReSharper disable InconsistentNaming private const string JOB = "Job [-]"; @@ -254,5 +255,17 @@ namespace TUGraz.VectoCore.OutputData { return text.Replace('#', '_').Replace(',', '_').Replace('\n', '_').Replace('\r', '_'); } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposing) + _table.Dispose(); + } } } \ No newline at end of file