mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 05:22:00 +00:00
Wayland: Fix segfault on termination
A segfault could occur during termination if libdecor was found but no windows were created between initialization and termination. The wait for libdecor to finish its initialization was only performed before window creation, not at termination. Regression introduced by9fdc425931
. This was adapted to 3.3-stable from4e8c4901e9
.
This commit is contained in:
parent
a943d9ac17
commit
c710d2c05d
@ -123,6 +123,7 @@ information on what to include when reporting a bug.
|
||||
|
||||
## Changelog
|
||||
|
||||
- [Wayland] Bugfix: Terminating the library before showing a window could segfault
|
||||
- [Linux] Bugfix: `regfree´ was called on invalid data (#2464)
|
||||
|
||||
|
||||
|
@ -637,10 +637,15 @@ void _glfwPlatformTerminate(void)
|
||||
_glfwTerminateEGL();
|
||||
_glfwTerminateOSMesa();
|
||||
|
||||
if (_glfw.wl.libdecor.callback)
|
||||
wl_callback_destroy(_glfw.wl.libdecor.callback);
|
||||
if (_glfw.wl.libdecor.context)
|
||||
{
|
||||
// Allow libdecor to finish receiving all its requested globals
|
||||
// and ensure the associated sync callback object is destroyed
|
||||
while (!_glfw.wl.libdecor.ready)
|
||||
_glfwPlatformWaitEvents();
|
||||
|
||||
libdecor_unref(_glfw.wl.libdecor.context);
|
||||
}
|
||||
|
||||
if (_glfw.wl.libdecor.handle)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user