From c7aaa1bc6b273afbaa6280dce68c2cf3dffd9abe Mon Sep 17 00:00:00 2001 From: fayjf Date: Sat, 29 May 2010 02:07:21 +0000 Subject: [PATCH] Fixing "fgDestroyWindow" error per e-mail from John Tsiombikas dated Wed, 26 May 2010 13:16:28 +0200 git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@876 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/freeglut_window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/src/freeglut_window.c b/freeglut/freeglut/src/freeglut_window.c index d7f969b..00bdfdd 100644 --- a/freeglut/freeglut/src/freeglut_window.c +++ b/freeglut/freeglut/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