Fixes #2913 - remove Disposed views from Responder.instances when Debugging (#2914)

* fix issue #2913

* remove disposed instances from responder.instances (optional)

* Ensures only clear Instances if they really was disposed.

* Fix unit tests.

* Update RunStateTests.cs

Minor format change to trigger new Unittest execution

* Fixes Pos/Dim static fields not being disposing.

---------

Co-authored-by: John Züchler <john.zuechler@eks-intec.de>
Co-authored-by: BDisp <bd.bdisp@gmail.com>
This commit is contained in:
usr
2023-10-25 15:02:46 +02:00
committed by GitHub
parent 3e1637aac8
commit a8d2f8d733
6 changed files with 29 additions and 51 deletions

View File

@@ -32,9 +32,7 @@ namespace Terminal.Gui.TopLevelTests {
Application.Shutdown ();
#if DEBUG_IDISPOSABLE
Assert.Equal (2, Responder.Instances.Count);
Assert.True (Responder.Instances [0].WasDisposed);
Assert.True (Responder.Instances [1].WasDisposed);
Assert.Empty (Responder.Instances);
#endif
}
@@ -49,9 +47,7 @@ namespace Terminal.Gui.TopLevelTests {
Application.Shutdown ();
#if DEBUG_IDISPOSABLE
Assert.Equal (2, Responder.Instances.Count);
Assert.True (Responder.Instances [0].WasDisposed);
Assert.True (Responder.Instances [1].WasDisposed);
Assert.Empty (Responder.Instances);
#endif
}