From: John F. Fay Date: Sat, 17 Dec 2011 13:19:25 +0000 (+0000) Subject: Removing the "atexit ( fgDeinitialize )" call from the Windows code per e-mail trail... X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=e31cce4d7a8789dc9c0dc723c4c13e719ad2db86;p=freeglut Removing the "atexit ( fgDeinitialize )" call from the Windows code per e-mail trail culminating in a message from Martin Payne dated 12/17/11 at 4:43 AM git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@956 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 194248a..44bb42f 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -390,7 +390,12 @@ static void fghInitialize( const char* displayName ) #endif fgState.Initialised = GL_TRUE; + + /* Avoid registering atexit callback on Win32 as it results in an access + * violation due to calling into a module which has been unloaded. */ +#ifndef TARGET_HOST_MS_WINDOWS atexit(fgDeinitialize); +#endif /* InputDevice uses GlutTimerFunc(), so fgState.Initialised must be TRUE */ fgInitialiseInputDevices();