Add GC.SuppressFinalize

This commit is contained in:
BDisp
2025-11-17 16:49:22 +00:00
parent 271c45492d
commit 2bd7cd7791
2 changed files with 3 additions and 0 deletions

View File

@@ -34,5 +34,6 @@ public abstract class FakeDriverBase : IDisposable
public void Dispose () public void Dispose ()
{ {
Application.ResetState (true); Application.ResetState (true);
GC.SuppressFinalize(this);
} }
} }

View File

@@ -16,6 +16,7 @@ public class GlobalTestSetup : IDisposable
CheckDefaultState (); CheckDefaultState ();
} }
/// <inheritdoc />
public void Dispose () public void Dispose ()
{ {
// Optionally reset EnableDebugIDisposableAsserts after tests. Don't do this. // Optionally reset EnableDebugIDisposableAsserts after tests. Don't do this.
@@ -26,6 +27,7 @@ public class GlobalTestSetup : IDisposable
// TODO: Add an Assert to ensure none of the state of ConfigurationManager changed. // TODO: Add an Assert to ensure none of the state of ConfigurationManager changed.
Application.ResetState (true); Application.ResetState (true);
CheckDefaultState (); CheckDefaultState ();
GC.SuppressFinalize (this);
} }
// IMPORTANT: Ensure this matches the code in Init_ResetState_Resets_Properties // IMPORTANT: Ensure this matches the code in Init_ResetState_Resets_Properties