ide/designer: Fixed closing Designer window when source file in use by Debugger
authorJerome St-Louis <jerome@ecere.com>
Fri, 6 Jun 2014 22:46:06 +0000 (18:46 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 6 Jun 2014 22:46:06 +0000 (18:46 -0400)
ide/src/designer/Designer.ec

index 1868f35..38ca035 100644 (file)
@@ -162,14 +162,27 @@ class Designer : DesignerBase
       {
          return codeEditor.MenuFileSaveAs(selection, mods);
       }
-
    };
+   bool debugClosing;
 
    bool OnClose(bool parentClosing)
    {
       if(!parentClosing)
       {
-         if(codeEditor && !codeEditor.closing)
+         if(codeEditor && codeEditor.inUseDebug && !debugClosing)
+         {
+            debugClosing = true;
+            closing = false;
+            if(CloseConfirmation(false))
+            {
+               visible = false;
+               if(modifiedDocument)
+                  OnFileModified({ modified = true }, null);
+            }
+            debugClosing = false;
+            return false;
+         }
+         if(codeEditor && !codeEditor.closing && !debugClosing)
          {
             if(!codeEditor.visible)
             {