Some memory management improvements

This commit is contained in:
tidusjar 2018-01-08 20:02:56 +00:00
parent 059b083359
commit 6ac9da8bed
30 changed files with 362 additions and 100 deletions

View file

@ -71,5 +71,27 @@ namespace Ombi.Store.Repository
{
return source.Include(navigationPropertyPath);
}
private bool _disposed;
// Protected implementation of Dispose pattern.
protected virtual void Dispose(bool disposing)
{
if (_disposed)
return;
if (disposing)
{
_ctx?.Dispose();
}
_disposed = true;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}