mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 08:50:15 +00:00
Allow NULL argument to _glfwPlatformFreeModule
This matches the behavior of _glfw_free and the public API, simplifying cleanup code.
This commit is contained in:
+8
-24
@@ -166,29 +166,6 @@ static GLFWbool loadLibraries(void)
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
// Unload used libraries (DLLs)
|
||||
//
|
||||
static void freeLibraries(void)
|
||||
{
|
||||
if (_glfw.win32.xinput.instance)
|
||||
_glfwPlatformFreeModule(_glfw.win32.xinput.instance);
|
||||
|
||||
if (_glfw.win32.dinput8.instance)
|
||||
_glfwPlatformFreeModule(_glfw.win32.dinput8.instance);
|
||||
|
||||
if (_glfw.win32.user32.instance)
|
||||
_glfwPlatformFreeModule(_glfw.win32.user32.instance);
|
||||
|
||||
if (_glfw.win32.dwmapi.instance)
|
||||
_glfwPlatformFreeModule(_glfw.win32.dwmapi.instance);
|
||||
|
||||
if (_glfw.win32.shcore.instance)
|
||||
_glfwPlatformFreeModule(_glfw.win32.shcore.instance);
|
||||
|
||||
if (_glfw.win32.ntdll.instance)
|
||||
_glfwPlatformFreeModule(_glfw.win32.ntdll.instance);
|
||||
}
|
||||
|
||||
// Create key code translation tables
|
||||
//
|
||||
static void createKeyTables(void)
|
||||
@@ -721,7 +698,14 @@ void _glfwTerminateWin32(void)
|
||||
_glfwTerminateEGL();
|
||||
_glfwTerminateOSMesa();
|
||||
|
||||
freeLibraries();
|
||||
_glfwPlatformFreeModule(_glfw.win32.xinput.instance);
|
||||
_glfwPlatformFreeModule(_glfw.win32.dinput8.instance);
|
||||
_glfwPlatformFreeModule(_glfw.win32.user32.instance);
|
||||
_glfwPlatformFreeModule(_glfw.win32.dwmapi.instance);
|
||||
_glfwPlatformFreeModule(_glfw.win32.shcore.instance);
|
||||
_glfwPlatformFreeModule(_glfw.win32.ntdll.instance);
|
||||
|
||||
memset(&_glfw.win32, 0, sizeof(_glfw.win32));
|
||||
}
|
||||
|
||||
#endif // _GLFW_WIN32
|
||||
|
||||
Reference in New Issue
Block a user