X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_init.c;h=d68341c0781fb4e9fb8552118d5b2210d514e808;hb=a4b002457118502712cd8d3f67de997b2a65f162;hp=eb0935b680c2e064afdf3c29a361907a99c263b1;hpb=9b943faa4f374b5a37b1bf6d544f826078cd361b;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index eb0935b..d68341c 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -68,13 +68,15 @@ SFG_State fgState = { { -1, -1, FALSE }, /* Position */ 0, /* FPSInterval */ 0, /* SwapCount */ 0, /* SwapTime */ -#ifdef TARGET_HOST_WIN32 +#if TARGET_HOST_WIN32 { 0, FALSE }, /* Time */ #else { { 0, 0 }, FALSE }, #endif { NULL, NULL }, /* Timers */ NULL, /* IdleCallback */ + FALSE, /* BuildingAMenu */ + 0, /* ActiveMenus */ NULL, /* MenuStateCallback */ NULL, /* MenuStatusCallback */ { 640, 480, TRUE }, /* GameModeSize */ @@ -269,6 +271,15 @@ void fgDeinitialize( void ) } /* + * If there was a menu created, destroy the rendering context + */ + if ( fgStructure.MenuContext ) + { + free ( fgStructure.MenuContext ) ; + fgStructure.MenuContext = NULL ; + } + + /* * Perform the freeglut structure deinitialization */ fgDestroyStructure(); @@ -276,7 +287,7 @@ void fgDeinitialize( void ) /* * Delete all the timers and their storage list */ - while ( (timer = fgState.Timers.First) != NULL ) + while ( (timer = (SFG_Timer *)fgState.Timers.First) != NULL ) { fgListRemove ( &fgState.Timers, &timer->Node ) ; free ( timer ) ; @@ -974,7 +985,7 @@ void FGAPIENTRY glutInitDisplayString( const char* displayMode ) */ char *token ; int len = strlen ( displayMode ) ; - char *buffer = malloc ( (len+1) * sizeof(char) ) ; + char *buffer = (char *)malloc ( (len+1) * sizeof(char) ) ; memcpy ( buffer, displayMode, len ) ; buffer[len] = '\0' ;