mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 14:18:26 +02:00
wl: Fix destroying CSDs in correct order (#3051)
On Wayland, some compositors refuse to implement SSDs in which case we draw primitive CSDs. However, the destructors were called in the wrong order, leading to a dereference of an already freed object.
This commit is contained in:
4
glfw/wl_window.c
vendored
4
glfw/wl_window.c
vendored
@@ -413,10 +413,10 @@ static void createDecorations(_GLFWwindow* window)
|
|||||||
|
|
||||||
static void destroyDecoration(_GLFWdecorationWayland* decoration)
|
static void destroyDecoration(_GLFWdecorationWayland* decoration)
|
||||||
{
|
{
|
||||||
if (decoration->surface)
|
|
||||||
wl_surface_destroy(decoration->surface);
|
|
||||||
if (decoration->subsurface)
|
if (decoration->subsurface)
|
||||||
wl_subsurface_destroy(decoration->subsurface);
|
wl_subsurface_destroy(decoration->subsurface);
|
||||||
|
if (decoration->surface)
|
||||||
|
wl_surface_destroy(decoration->surface);
|
||||||
if (decoration->viewport)
|
if (decoration->viewport)
|
||||||
wp_viewport_destroy(decoration->viewport);
|
wp_viewport_destroy(decoration->viewport);
|
||||||
decoration->surface = NULL;
|
decoration->surface = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user