/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
+void fgClearCallBacks( SFG_Window *window )
+{
+ int i;
+ for( i = 0; i < TOTAL_CALLBACKS; ++i )
+ window->CallBacks[ i ] = NULL;
+}
+
/*
* This private function creates, opens and adds to the hierarchy
* a freeglut window complete with OpenGL context and stuff...
SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
int fakeArgc = 0;
+ fgClearCallBacks( window );
+
/*
* If the freeglut internals haven't been initialized yet,
* do it now. Hack's idea courtesy of Chris Purnell...
while ( (subWindow = (SFG_Window *)window->Children.First) != NULL )
fgDestroyWindow( subWindow, needToClose );
+ /*
+ * XXX Since INVOKE_WCB() tests the function pointer, why not make
+ * XXX this unconditional? Overhead is close to nil, and it would
+ * XXX clarify the code by omitting a conditional test.
+ */
if ( FETCH_WCB( *window, Destroy ) )
{
SFG_Window *activeWindow = fgStructure.Window ;
- /* fgSetWindow ( window ) ; */
- /* window->Callbacks.Destroy () ; */
INVOKE_WCB( *window, Destroy, ( ) );
fgSetWindow ( activeWindow ) ;
}
free( window );
if ( fgStructure.Window == window )
fgStructure.Window = NULL ;
+ fgClearCallBacks( window );
}
/*