mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-30 09:47:58 +01:00
Prevents run iteration if toplevel's stack is empty.
This commit is contained in:
@@ -664,6 +664,15 @@ public static partial class Application
|
||||
// by using NotifyStopRunState event.
|
||||
RunLoop (runState);
|
||||
|
||||
if (runState.Toplevel is null)
|
||||
{
|
||||
#if DEBUG_IDISPOSABLE
|
||||
Debug.Assert (_topLevels.Count == 0);
|
||||
#endif
|
||||
runState.Dispose ();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!EndAfterFirstIteration)
|
||||
{
|
||||
End (runState);
|
||||
@@ -802,7 +811,7 @@ public static partial class Application
|
||||
|
||||
var firstIteration = true;
|
||||
|
||||
for (state.Toplevel.Running = true; state.Toplevel.Running;)
|
||||
for (state.Toplevel.Running = true; state.Toplevel?.Running == true;)
|
||||
{
|
||||
MainLoop.Running = true;
|
||||
|
||||
@@ -853,6 +862,11 @@ public static partial class Application
|
||||
|
||||
firstIteration = false;
|
||||
|
||||
if (Current == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.Toplevel != Top && (Top.NeedsDisplay || Top.SubViewNeedsDisplay || Top.LayoutNeeded))
|
||||
{
|
||||
state.Toplevel.SetNeedsDisplay (state.Toplevel.Frame);
|
||||
|
||||
Reference in New Issue
Block a user