Fix for a deinitialization related crash.
authorChristopher John Purnell <cjp@lost.org.uk>
Tue, 9 Sep 2003 17:40:53 +0000 (17:40 +0000)
committerChristopher John Purnell <cjp@lost.org.uk>
Tue, 9 Sep 2003 17:40:53 +0000 (17:40 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@179 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_structure.c

index 454aebf..9c515c8 100644 (file)
@@ -490,11 +490,11 @@ void fgDestroyStructure( void )
   /*
    * Make sure all windows and menus have been deallocated
    */
-  while( (window = (SFG_Window *)fgStructure.Windows.First) != NULL )
-    fgDestroyWindow( window, TRUE );
-
   while( (menu = (SFG_Menu *)fgStructure.Menus.First) != NULL )
     fgDestroyMenu( menu );
+
+  while( (window = (SFG_Window *)fgStructure.Windows.First) != NULL )
+    fgDestroyWindow( window, TRUE );
 }
 
 /*