Browse Source

Fixes #1167. Application.Run method with #DEBUG can be simplified. (#1168)

BDisp 4 years ago
parent
commit
11524630d3
1 changed files with 5 additions and 9 deletions
  1. 5 9
      Terminal.Gui/Core/Application.cs

+ 5 - 9
Terminal.Gui/Core/Application.cs

@@ -700,19 +700,15 @@ namespace Terminal.Gui {
 		public static void Run (Toplevel view, Func<Exception, bool> errorHandler = null)
 		{
 			var resume = true;
-			while (resume)
-			{
-#if DEBUG
+			while (resume) {
+#if !DEBUG
+				try {
+#endif
 				resume = false;
 				var runToken = Begin (view);
 				RunLoop (runToken);
 				End (runToken);
-#else
-				try {
-					resume = false;
-					var runToken = Begin (view);
-					RunLoop (runToken);
-					End (runToken);
+#if !DEBUG
 				}
 				catch (Exception error)
 				{