From: John F. Fay Date: Sat, 29 May 2010 02:07:21 +0000 (+0000) Subject: Fixing "fgDestroyWindow" error per e-mail from John Tsiombikas dated Wed, 26 May... X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=026710ef54197b252aec1082765bdc61fe2bb731;p=freeglut Fixing "fgDestroyWindow" error per e-mail from John Tsiombikas dated Wed, 26 May 2010 13:16:28 +0200 git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@876 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/freeglut_window.c b/src/freeglut_window.c index d7f969b..00bdfdd 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -1282,7 +1282,10 @@ void fgCloseWindow( SFG_Window* window ) if( window->Window.Context ) glXDestroyContext( fgDisplay.Display, window->Window.Context ); XFree( window->Window.FBConfig ); - XDestroyWindow( fgDisplay.Display, window->Window.Handle ); + + if( window->Window.Handle ) { + XDestroyWindow( fgDisplay.Display, window->Window.Handle ); + } /* XFlush( fgDisplay.Display ); */ /* XXX Shouldn't need this */ #elif TARGET_HOST_MS_WINDOWS