with #520 fixed, cleaning up comments and tests

This commit is contained in:
Charlie Kindel
2022-11-04 11:32:41 -06:00
parent 04af7d2106
commit 812a389082
4 changed files with 2 additions and 11 deletions

View File

@@ -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;

View File

@@ -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> ();
}

View File

@@ -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 [] {

View File

@@ -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 ();