From d657a564e5432de617ad0c1bdc3b25a8ed7a375b Mon Sep 17 00:00:00 2001 From: dcnieho Date: Thu, 17 Jan 2013 14:51:25 +0000 Subject: [PATCH] fixed closing window crash, thanks Philipp! git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1495 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/x11/fg_main_x11.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/freeglut/freeglut/src/x11/fg_main_x11.c b/freeglut/freeglut/src/x11/fg_main_x11.c index c77f5e4..8387ba8 100644 --- a/freeglut/freeglut/src/x11/fg_main_x11.c +++ b/freeglut/freeglut/src/x11/fg_main_x11.c @@ -628,10 +628,11 @@ void fgPlatformProcessSingleEvent ( void ) switch( event.type ) { case ClientMessage: - if(fgIsSpaceballXEvent(&event)) { - fgSpaceballHandleXEvent(&event); - break; - } + if (fgStructure.CurrentWindow) + if(fgIsSpaceballXEvent(&event)) { + fgSpaceballHandleXEvent(&event); + break; + } /* Destroy the window when the WM_DELETE_WINDOW message arrives */ if( (Atom) event.xclient.data.l[ 0 ] == fgDisplay.pDisplay.DeleteWindow ) {