From 6af9cb78643b6b461c8886cb1ec6f935c8107429 Mon Sep 17 00:00:00 2001 From: Richard Rauch Date: Fri, 7 Nov 2003 10:18:10 +0000 Subject: [PATCH] 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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@317 7f0cb862-5218-0410-a997-914c9d46530a --- src/freeglut_internal.h | 4 ++-- src/freeglut_structure.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/freeglut_internal.h b/src/freeglut_internal.h index 45dd726..f74b71c 100644 --- a/src/freeglut_internal.h +++ b/src/freeglut_internal.h @@ -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 diff --git a/src/freeglut_structure.c b/src/freeglut_structure.c index 30a905b..e11cdf7 100644 --- a/src/freeglut_structure.c +++ b/src/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 ); } /* -- 1.7.10.4