X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_structure.c;h=949747ba0da11bfcea01b08b578bf64292b098ee;hb=a7c34bdfaa680a83bf796eac2f2da20b92f4c139;hp=21b6cfb976637df472a657982fdd8fc5cd5b8b40;hpb=9092fad9f750e8bab3ce7d7fc5a30f2b036a1cfb;p=freeglut diff --git a/src/freeglut_structure.c b/src/freeglut_structure.c index 21b6cfb..949747b 100644 --- a/src/freeglut_structure.c +++ b/src/freeglut_structure.c @@ -54,9 +54,12 @@ SFG_Structure fgStructure = { { NULL, NULL }, /* The list of windows */ void fgClearCallBacks( SFG_Window *window ) { - int i; - for( i = 0; i < TOTAL_CALLBACKS; ++i ) - window->CallBacks[ i ] = NULL; + if( window ) + { + int i; + for( i = 0; i < TOTAL_CALLBACKS; ++i ) + window->CallBacks[ i ] = NULL; + } } /* @@ -314,12 +317,12 @@ void fgDestroyWindow( SFG_Window* window, GLboolean needToClose ) window->Menu[menu_index]->ParentWindow = NULL ; } + fgClearCallBacks( window ); if( needToClose == TRUE ) fgCloseWindow( window ); free( window ); if( fgStructure.Window == window ) fgStructure.Window = NULL; - fgClearCallBacks( window ); } /*