Wayland: egl _glfwPlatformFreeModule calls moved to end

This commit is contained in:
Doug Binks 2025-11-08 12:19:04 +00:00
parent c1ff180f4e
commit a281536b6b
2 changed files with 8 additions and 1 deletions

View File

@ -555,7 +555,8 @@ void _glfwTerminateEGL(void)
_glfw.egl.display = EGL_NO_DISPLAY;
}
if (_glfw.egl.handle)
// Free modules only after all wayland termination functions are called
if (_glfw.egl.handle && _glfw.platform.platformID != GLFW_PLATFORM_WAYLAND)
{
_glfwPlatformFreeModule(_glfw.egl.handle);
_glfw.egl.handle = NULL;

View File

@ -982,6 +982,12 @@ void _glfwTerminateWayland(void)
close(_glfw.wl.cursorTimerfd);
// Free modules only after all wayland termination functions are called
if (_glfw.egl.handle)
{
_glfwPlatformFreeModule(_glfw.egl.handle);
_glfw.egl.handle = NULL;
}
if (_glfw.wl.libdecor.handle)
{
_glfwPlatformFreeModule(_glfw.wl.libdecor.handle);