소스 검색

Fix unit test error not disposing static variables.

BDisp 2 년 전
부모
커밋
8715af2a42
3개의 변경된 파일10개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      Terminal.Gui/Core/Application.cs
  2. 7 0
      Terminal.Gui/Core/Toplevel.cs
  3. 2 0
      UnitTests/TopLevels/ToplevelTests.cs

+ 1 - 0
Terminal.Gui/Core/Application.cs

@@ -1134,6 +1134,7 @@ namespace Terminal.Gui {
 			_initialized = false;
 			mouseGrabView = null;
 			_enableConsoleScrolling = false;
+			lastMouseOwnerView = null;
 
 			// Reset synchronization context to allow the user to run async/await,
 			// as the main loop has been ended, the synchronization context from 

+ 7 - 0
Terminal.Gui/Core/Toplevel.cs

@@ -984,6 +984,13 @@ namespace Terminal.Gui {
 		{
 			return MostFocused?.OnLeave (view) ?? base.OnLeave (view);
 		}
+
+		///<inheritdoc/>
+		protected override void Dispose (bool disposing)
+		{
+			dragPosition = null;
+			base.Dispose (disposing);
+		}
 	}
 
 	/// <summary>

+ 2 - 0
UnitTests/TopLevels/ToplevelTests.cs

@@ -1163,6 +1163,8 @@ namespace Terminal.Gui.TopLevelTests {
                     │           this.            │
                     │                            │
                     └────────────────────────────┘", output);
+
+			Application.End (rs);
 		}
 	}
 }