]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Set the 'must_close_session' flag at the end of close_session(), so
authorSimon Tatham <anakin@pobox.com>
Wed, 2 Mar 2011 18:52:03 +0000 (18:52 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 2 Mar 2011 18:52:03 +0000 (18:52 +0000)
that we won't keep calling close_session() again the next time we go
round the message loop. Should fix unclean-close-hang. Thanks to Simon
Coleman for debugging.

[originally from svn r9115]

windows/window.c

index f721ed97584cf17be529c364f07a9c1127c9a686..c8c2b56d06be0dd1a83c54f66c05956ed8746d81 100644 (file)
@@ -311,6 +311,15 @@ static void close_session(void)
        InsertMenu(popup_menus[i].menu, IDM_DUPSESS, MF_BYCOMMAND | MF_ENABLED,
                   IDM_RESTART, "&Restart Session");
     }
+
+    /*
+     * Unset the 'must_close_session' flag, or else we'll come
+     * straight back here the next time we go round the main message
+     * loop - which, worse still, will be immediately (without
+     * blocking) because we've just triggered a WM_SETTEXT by the
+     * window title change above.
+     */
+    must_close_session = FALSE;
 }
 
 int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)