Browse Source

Verify runstate.Top never equals Top

Tig 1 year ago
parent
commit
68a07cfddb
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Terminal.Gui/Application.cs

+ 6 - 2
Terminal.Gui/Application.cs

@@ -1028,11 +1028,15 @@ public static partial class Application
             Refresh ();
         }
 
+        if (Top == runState.Toplevel)
+        {
+           // Top = null;
+        }
+
+        Debug.Assert(Current != runState.Toplevel);
         runState.Toplevel?.Dispose ();
         runState.Toplevel = null;
         runState.Dispose ();
-
-        // BUGBUG: Application.Top is now invalid?!?!
     }
 
     #endregion Run (Begin, Run, End)