|
@@ -846,10 +846,15 @@ void _glfwTerminateWayland(void)
|
|
_glfwTerminateEGL();
|
|
_glfwTerminateEGL();
|
|
_glfwTerminateOSMesa();
|
|
_glfwTerminateOSMesa();
|
|
|
|
|
|
- if (_glfw.wl.libdecor.callback)
|
|
|
|
- wl_callback_destroy(_glfw.wl.libdecor.callback);
|
|
|
|
if (_glfw.wl.libdecor.context)
|
|
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)
|
|
|
|
+ _glfwWaitEventsWayland();
|
|
|
|
+
|
|
libdecor_unref(_glfw.wl.libdecor.context);
|
|
libdecor_unref(_glfw.wl.libdecor.context);
|
|
|
|
+ }
|
|
|
|
|
|
if (_glfw.wl.libdecor.handle)
|
|
if (_glfw.wl.libdecor.handle)
|
|
{
|
|
{
|