Prevent "Connection closed" message box from appearing after the
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 29 Jan 2001 14:31:57 +0000 (14:31 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Mon, 29 Jan 2001 14:31:57 +0000 (14:31 +0000)
"Network error" box. The latter on its own is enough.

git-svn-id: svn://svn.tartarus.org/sgt/putty@911 cda61777-01e9-0310-a592-d414129be87e

window.c

index cef6825..c1f3fac 100644 (file)
--- a/window.c
+++ b/window.c
@@ -696,10 +696,12 @@ static void enact_pending_netevent(void) {
        if (cfg.close_on_exit)
            PostQuitMessage(0);
        else {
-           session_closed = TRUE;
-           MessageBox(hwnd, "Connection closed by remote host",
-                      "PuTTY", MB_OK | MB_ICONINFORMATION);
-           SetWindowText (hwnd, "PuTTY (inactive)");
+            if (!session_closed) {
+                session_closed = TRUE;
+                SetWindowText (hwnd, "PuTTY (inactive)");
+                MessageBox(hwnd, "Connection closed by remote host",
+                           "PuTTY", MB_OK | MB_ICONINFORMATION);
+            }
        }
     }
 }