Oh well, I might as well add the call to clear callbacks on window

destruction.  Also renamed the function to do this: fgClearCallBacks().
Ho-hum.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@317 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2003-11-07 10:18:10 +00:00
parent 89cbd97e02
commit 2ddf15c536
2 changed files with 5 additions and 4 deletions

View File

@ -697,7 +697,7 @@ GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
/* /*
* Window creation, opening, closing and destruction. * Window creation, opening, closing and destruction.
* Also CallBack initialization. * Also CallBack clearing/initialization.
* Defined in freeglut_structure.c, freeglut_window.c. * Defined in freeglut_structure.c, freeglut_window.c.
*/ */
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
@ -711,7 +711,7 @@ void fgAddToWindowDestroyList ( SFG_Window* window,
GLboolean needToClose ) ; GLboolean needToClose ) ;
void fgCloseWindows (); void fgCloseWindows ();
void fgDestroyWindow( SFG_Window* window, GLboolean needToClose ); 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 * Menu creation and destruction. Defined in freeglut_structure.c

View File

@ -52,7 +52,7 @@ SFG_Structure fgStructure = { { NULL, NULL }, /* The list of windows */
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */ /* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
void fgInitCallBacks( SFG_Window *window ) void fgClearCallBacks( SFG_Window *window )
{ {
int i; int i;
for( i = 0; i < TOTAL_CALLBACKS; ++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 ); SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
int fakeArgc = 0; int fakeArgc = 0;
fgInitCallBacks( window ); fgClearCallBacks( window );
/* /*
* If the freeglut internals haven't been initialized yet, * If the freeglut internals haven't been initialized yet,
@ -306,6 +306,7 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose )
free( window ); free( window );
if ( fgStructure.Window == window ) if ( fgStructure.Window == window )
fgStructure.Window = NULL ; fgStructure.Window = NULL ;
fgClearCallBacks( window );
} }
/* /*