diff --git a/Terminal.Gui/Core/Application.cs b/Terminal.Gui/Core/Application.cs index 30b39e0d9..d00eaf80b 100644 --- a/Terminal.Gui/Core/Application.cs +++ b/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; diff --git a/UICatalog/Scenarios/BackgroundWorkerCollection.cs b/UICatalog/Scenarios/BackgroundWorkerCollection.cs index b351d19ba..13ebcc1a4 100644 --- a/UICatalog/Scenarios/BackgroundWorkerCollection.cs +++ b/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` to create a new Toplevel: - // Override `Run` and call `Application.Top.Dispose` before calling `Application.Run`. - //if (Application.Top != null) { - // Application.Top.Dispose (); - //} - Application.Run (); } diff --git a/UICatalog/Scenarios/WizardAsView.cs b/UICatalog/Scenarios/WizardAsView.cs index e7e5a025e..e7be17552 100644 --- a/UICatalog/Scenarios/WizardAsView.cs +++ b/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 [] { diff --git a/UnitTests/ApplicationTests.cs b/UnitTests/ApplicationTests.cs index 5d7d623b7..c9a54583e 100644 --- a/UnitTests/ApplicationTests.cs +++ b/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 ();