Changed the overlay (freeglut_state.c:662) to return FALSE, as it's not imp
[freeglut] / freeglut-1.3 / freeglut_structure.c
index 2c26259..6b54d50 100644 (file)
@@ -252,6 +252,7 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose )
 
     /*
      * If the programmer defined a destroy callback, call it
+     * A. Donev: But first make this the active window
      */
     if ( window->Callbacks.Destroy != NULL )
     {
@@ -359,6 +360,18 @@ void fgDestroyMenu( SFG_Menu* menu )
   }
 
   /*
+   * If the programmer defined a destroy callback, call it
+   * A. Donev: But first make this the active menu
+   */    
+  if ( menu->Destroy != NULL )
+  {
+    SFG_Menu *activeMenu=fgStructure.Menu;
+    fgStructure.Menu = menu;    
+    menu->Destroy () ;  
+    fgStructure.Menu = activeMenu;     
+  }        
+
+  /*
    * Now we are pretty sure the menu is not used anywhere
    * and that we can remove all of its entries
    */