From b6817e508c50718ac93da48d14ac2ba7092ed954 Mon Sep 17 00:00:00 2001 From: "John F. Fay" Date: Wed, 1 Jun 2011 11:44:00 +0000 Subject: [PATCH] Fixing a 'gamemode at_exit' bug courtesy of Diederick Niehorster per e-mail dated 6/1/11 1:50 AM git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@922 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_window.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 41c3fe7..7d50a9d 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -1332,10 +1332,11 @@ void fgOpenWindow( SFG_Window* window, const char* title, */ void fgCloseWindow( SFG_Window* window ) { - /* if we're in gamemode, call glutLeaveGameMode first to make sure the - * gamemode is properly closed before closing the window + /* if we're in gamemode and we're closing the gamemode window, + * call glutLeaveGameMode first to make sure the gamemode is + * properly closed before closing the window */ - if (fgStructure.GameModeWindow != NULL) + if (fgStructure.GameModeWindow != NULL && fgStructure.GameModeWindow->ID==window->ID) glutLeaveGameMode(); #if TARGET_HOST_POSIX_X11 -- 1.7.10.4