Moved atexit call to shared code.

master
Camilla Berglund ago%!(EXTRA string=15 years)
parent 1f704a2408
commit 3c85eef0bf
  1. 12
      src/cocoa/cocoa_init.m
  2. 13
      src/init.c
  3. 14
      src/win32/win32_init.c
  4. 13
      src/x11/x11_init.c

@ -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 =

@ -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;

@ -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;

@ -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();

Loading…
Cancel
Save