Oh well, I might as well add the call to clear callbacks on window
authorRichard Rauch <rkr@olib.org>
Fri, 7 Nov 2003 10:18:10 +0000 (10:18 +0000)
committerRichard Rauch <rkr@olib.org>
Fri, 7 Nov 2003 10:18:10 +0000 (10:18 +0000)
destruction.  Also renamed the function to do this: fgClearCallBacks().
Ho-hum.

git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@317 7f0cb862-5218-0410-a997-914c9d46530a

src/freeglut_internal.h
src/freeglut_structure.c

index 45dd726..f74b71c 100644 (file)
@@ -697,7 +697,7 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
 
 /*
  * Window creation, opening, closing and destruction.
- * Also CallBack initialization.
+ * Also CallBack clearing/initialization.
  * Defined in freeglut_structure.c, freeglut_window.c.
  */
 SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
@@ -711,7 +711,7 @@ void        fgAddToWindowDestroyList ( SFG_Window* window,
                                        GLboolean needToClose ) ;
 void        fgCloseWindows ();
 void        fgDestroyWindow( SFG_Window* window, GLboolean needToClose );
-void        fgInitCallBacks( SFG_Window *window );
+void        fgClearCallBacks( SFG_Window *window );
 
 /*
  * Menu creation and destruction. Defined in freeglut_structure.c
index 30a905b..e11cdf7 100644 (file)
@@ -52,7 +52,7 @@ SFG_Structure fgStructure = { { NULL, NULL },  /* The list of windows       */
 
 /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
 
-void fgInitCallBacks( SFG_Window *window )
+void fgClearCallBacks( SFG_Window *window )
 {
     int i;
     for( i = 0; i < TOTAL_CALLBACKS; ++i )
@@ -74,7 +74,7 @@ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
     SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
     int fakeArgc = 0;
 
-    fgInitCallBacks( window );
+    fgClearCallBacks( window );
 
     /*
      * If the freeglut internals haven't been initialized yet,
@@ -306,6 +306,7 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose )
     free( window );
     if ( fgStructure.Window == window )
         fgStructure.Window = NULL ;
+    fgClearCallBacks( window );
 }
 
 /*