瀏覽代碼

with #520 fixed, cleaning up comments and tests

Charlie Kindel 2 年之前
父節點
當前提交
812a389082

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

@@ -1046,14 +1046,13 @@ namespace Terminal.Gui {
 			// Shutdown is the bookend for Init. As such it needs to clean up all resources
 			// Init created. Apps that do any threading will need to code defensively for this.
 			// e.g. see Issue #537
-			// TODO: Some of this state is actually related to Begin/End (not Init/Shutdown) and should be moved to `RunState` (#520)
 			foreach (var t in toplevels) {
 				t.Running = false;
 				t.Dispose ();
 			}
 			toplevels.Clear ();
 			Current = null;
-			// Fix #520: Dispose Top
+			// Fixes #520: Dispose Top
 			Top?.Dispose ();
 			Top = null;
 

+ 0 - 7
UICatalog/Scenarios/BackgroundWorkerCollection.cs

@@ -19,13 +19,6 @@ namespace UICatalog.Scenarios {
 
 		public override void Run ()
 		{
-			// BUGBUG: work around Issue #520: Ensuring the `Toplevel` created by `Init` gets Disposed...
-			// For Scenarios that want to use `Applciation.Run<T>` to create a new Toplevel: 
-			// Override `Run` and call `Application.Top.Dispose` before calling `Application.Run<T>`.
-			//if (Application.Top != null) {
-			//	Application.Top.Dispose ();
-			//}
-
 			Application.Run<MdiMain> ();
 		}
 

+ 0 - 1
UICatalog/Scenarios/WizardAsView.cs

@@ -13,7 +13,6 @@ namespace UICatalog.Scenarios {
 		public override void Init (ColorScheme colorScheme)
 		{
 			Application.Init ();
-			Top = Application.Top;
 
 			var menu = new MenuBar (new MenuBarItem [] {
 				new MenuBarItem ("_File", new MenuItem [] {

+ 1 - 1
UnitTests/ApplicationTests.cs

@@ -72,7 +72,7 @@ namespace Terminal.Gui.Core {
 
 			// BUGBUG: Because of #520, the Toplevel created by Application.Init is not disposed by Shutdown
 			// So we need to dispose it manually
-			Application.Top.Dispose ();
+			//Application.Top.Dispose ();
 
 			Application.Shutdown ();