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:
parent
89cbd97e02
commit
2ddf15c536
@ -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
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user