1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-26 20:28:49 -05:00

Moved atexit call to shared code.

This commit is contained in:
Camilla Berglund 2010-09-16 04:11:06 +02:00
parent 1f704a2408
commit 3c85eef0bf
4 changed files with 13 additions and 39 deletions

View File

@ -178,15 +178,6 @@ static void setUpMenuBar( void )
[NSApp setAppleMenu:appMenu];
}
//========================================================================
// Terminate GLFW when exiting application
//========================================================================
static void glfw_atexit(void)
{
glfwTerminate();
}
//////////////////////////////////////////////////////////////////////////
////// GLFW platform API //////
@ -213,9 +204,6 @@ int _glfwPlatformInit(void)
[NSApp finishLaunching];
// Install atexit routine
atexit(glfw_atexit);
_glfwPlatformSetTime(0.0);
_glfwLibrary.NS.desktopMode =

View File

@ -32,6 +32,17 @@
#include "internal.h"
#include <string.h>
#include <stdlib.h>
//========================================================================
// Terminate GLFW when exiting application
//========================================================================
static void glfw_atexit(void)
{
glfwTerminate();
}
//////////////////////////////////////////////////////////////////////////
@ -55,6 +66,8 @@ GLFWAPI int glfwInit(void)
return GL_FALSE;
}
atexit(glfw_atexit);
_glfwInitialized = GL_TRUE;
return GL_TRUE;

View File

@ -30,8 +30,6 @@
#include "internal.h"
#include <stdlib.h>
#ifdef __BORLANDC__
// With the Borland C++ compiler, we want to disable FPU exceptions
#include <float.h>
@ -125,16 +123,6 @@ static void freeLibraries(void)
}
//========================================================================
// Terminate GLFW when exiting application
//========================================================================
static void glfw_atexit(void)
{
glfwTerminate();
}
//////////////////////////////////////////////////////////////////////////
////// GLFW platform API //////
//////////////////////////////////////////////////////////////////////////
@ -164,8 +152,6 @@ int _glfwPlatformInit(void)
_glfwLibrary.Win32.instance = GetModuleHandle(NULL);
atexit(glfw_atexit);
_glfwInitTimer();
return GL_TRUE;

View File

@ -61,16 +61,6 @@ static void initLibraries(void)
}
//========================================================================
// Terminate GLFW when exiting application
//========================================================================
static void glfw_atexit(void)
{
glfwTerminate();
}
//========================================================================
// Initialize X11 display
//========================================================================
@ -197,9 +187,6 @@ int _glfwPlatformInit(void)
// Try to load libGL.so if necessary
initLibraries();
// Install atexit() routine
atexit(glfw_atexit);
// Initialize joysticks
_glfwInitJoysticks();