Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit be644ba2 authored by Michael KRISPER's avatar Michael KRISPER
Browse files

implemented IDisposable

parent b2c344a3
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -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
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment