MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / terminate

Function terminate

extern/glfw/src/init.c:62–107  ·  view source on GitHub ↗

Terminate the library

Source from the content-addressed store, hash-verified

60// Terminate the library
61//
62static void terminate(void)
63{
64 int i;
65
66 memset(&_glfw.callbacks, 0, sizeof(_glfw.callbacks));
67
68 while (_glfw.windowListHead)
69 glfwDestroyWindow((GLFWwindow*) _glfw.windowListHead);
70
71 while (_glfw.cursorListHead)
72 glfwDestroyCursor((GLFWcursor*) _glfw.cursorListHead);
73
74 for (i = 0; i < _glfw.monitorCount; i++)
75 {
76 _GLFWmonitor* monitor = _glfw.monitors[i];
77 if (monitor->originalRamp.size)
78 _glfwPlatformSetGammaRamp(monitor, &monitor->originalRamp);
79 _glfwFreeMonitor(monitor);
80 }
81
82 free(_glfw.monitors);
83 _glfw.monitors = NULL;
84 _glfw.monitorCount = 0;
85
86 free(_glfw.mappings);
87 _glfw.mappings = NULL;
88 _glfw.mappingCount = 0;
89
90 _glfwTerminateVulkan();
91 _glfwPlatformTerminate();
92
93 _glfw.initialized = GLFW_FALSE;
94
95 while (_glfw.errorListHead)
96 {
97 _GLFWerror* error = _glfw.errorListHead;
98 _glfw.errorListHead = error->next;
99 free(error);
100 }
101
102 _glfwPlatformDestroyTls(&_glfw.contextSlot);
103 _glfwPlatformDestroyTls(&_glfw.errorSlot);
104 _glfwPlatformDestroyMutex(&_glfw.errorLock);
105
106 memset(&_glfw, 0, sizeof(_glfw));
107}
108
109
110//////////////////////////////////////////////////////////////////////////

Callers 4

throw_exceptionFunction · 0.85
catch.hppFile · 0.85
glfwInitFunction · 0.85
glfwTerminateFunction · 0.85

Calls 8

glfwDestroyWindowFunction · 0.85
glfwDestroyCursorFunction · 0.85
_glfwFreeMonitorFunction · 0.85
_glfwTerminateVulkanFunction · 0.85
_glfwPlatformTerminateFunction · 0.70
_glfwPlatformDestroyTlsFunction · 0.70

Tested by

no test coverage detected