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

@ -25,6 +25,7 @@
// ************************************************************************/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -109,5 +110,24 @@ namespace Ombi.Store.Repository
Db.EmbyEpisode.AddRange(content);
await Db.SaveChangesAsync();
}
private bool _disposed;
protected virtual void Dispose(bool disposing)
{
if (_disposed)
return;
if (disposing)
{
Db?.Dispose();
}
_disposed = true;
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
}
}