Add IDisposable interface
MODIFY
WalletWasabi.Backend/Global.cs
WalletWasabi.Backend/Global.cs
@@ -17,8 +17,10 @@ using WalletWasabi.WabiSabi;
namespace WalletWasabi.Backend;
-public class Global
+public class Global : IDisposable
{
+ private bool _disposedValue;
+
public Global(string dataDir)
{
DataDir = dataDir ?? EnvironmentHelpers.GetDataDir(Path.Combine("WalletWasabi", "Backend"));
@@ -156,4 +158,23 @@ public class Global
throw;
}
}
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!_disposedValue)
+ {
+ if (disposing)
+ {
+ // TODO: dispose managed state (managed objects)
+ }
+
+ _disposedValue = true;
+ }
+ }
+
+ public void Dispose()
+ {
+ Dispose(disposing: true);
+ GC.SuppressFinalize(this);
+ }
}

Add IDisposable interface