Fixed a memory leak (thanks for the correction, John!).

Smoothed over some code style issues while I was here, but left the
init-string parsing alone for now.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@292 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2003-11-03 21:41:07 +00:00
parent 7c699fab2f
commit 9b257588e0

View File

@ -37,11 +37,13 @@
/*
* TODO BEFORE THE STABLE RELEASE:
*
* fgDeinitialize() -- Win32's OK, X11 needs the OS-specific deinitialization done
* fgDeinitialize() -- Win32's OK, X11 needs the OS-specific
* deinitialization done
* glutInitDisplayString() -- display mode string parsing
*
* Wouldn't it be cool to use gettext() for error messages? I just love bash saying
* "nie znaleziono pliku" instead of "file not found" :) Is gettext easily portable?
* Wouldn't it be cool to use gettext() for error messages? I just love
* bash saying "nie znaleziono pliku" instead of "file not found" :)
* Is gettext easily portable?
*/
/* -- GLOBAL VARIABLES ----------------------------------------------------- */
@ -224,7 +226,7 @@ void fgDeinitialize( void )
fgDestroyStructure();
while ( (timer = (SFG_Timer *)fgState.Timers.First) != NULL )
while( timer = (SFG_Timer *)fgState.Timers.First )
{
fgListRemove ( &fgState.Timers, &timer->Node );
free( timer );
@ -269,15 +271,24 @@ void fgDeinitialize( void )
fgState.SwapTime = 0;
fgState.FPSInterval = 0;
if( fgState.ProgramName )
{
free( fgState.ProgramName );
fgState.ProgramName = NULL;
}
#if TARGET_HOST_UNIX_X11
/*
* Make sure all X-client data we have created will be destroyed on display closing
* Make sure all X-client data we have created will be destroyed on
* display closing
*/
XSetCloseDownMode( fgDisplay.Display, DestroyAll );
/*
* Close the display connection, destroying all windows we have created so far
* Close the display connection, destroying all windows we have
* created so far
*/
XCloseDisplay( fgDisplay.Display );
@ -478,7 +489,6 @@ void FGAPIENTRY glutInitWindowPosition( int x, int y )
{
if( (x >= 0) && (y >= 0) )
{
fgState.Position.X = x;
fgState.Position.Y = y;
fgState.Position.Use = TRUE;