X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffreeglut_init.c;h=8c254bc888469a993b5a76374efea399fda8f5da;hb=62f61e0957a93d5d6188e146cf5f2aeaf98e6161;hp=194248a4ded782932f9fc5aff23e32275535ccd7;hpb=20c326dd70f34697350611e53ad6fe5435b5240f;p=freeglut diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 194248a..8c254bc 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. */ +#if ( TARGET_HOST_MS_WINDOWS == 0 ) atexit(fgDeinitialize); +#endif /* InputDevice uses GlutTimerFunc(), so fgState.Initialised must be TRUE */ fgInitialiseInputDevices();