Fixing "fgDestroyWindow" error per e-mail from John Tsiombikas dated Wed, 26 May...
authorJohn F. Fay <johnffay@nettally.com>
Sat, 29 May 2010 02:07:21 +0000 (02:07 +0000)
committerJohn F. Fay <johnffay@nettally.com>
Sat, 29 May 2010 02:07:21 +0000 (02:07 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@876 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_window.c

index d7f969b..00bdfdd 100644 (file)
@@ -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