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.
|
* 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
|
||||||
|
@ -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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user