From 7b239edb838a47f1b0a03b8257f1cd353f9d14c0 Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 28 Jul 2021 01:00:00 -0400 Subject: [PATCH] wayland: Assign frame_callback on window creation. Fixes a crash when creating and destroying a window without calling SwapWindow. --- src/video/wayland/SDL_waylandwindow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/wayland/SDL_waylandwindow.c b/src/video/wayland/SDL_waylandwindow.c index daeb55f13..244bb4862 100644 --- a/src/video/wayland/SDL_waylandwindow.c +++ b/src/video/wayland/SDL_waylandwindow.c @@ -1136,7 +1136,8 @@ int Wayland_CreateWindow(_THIS, SDL_Window *window) * window isn't visible. */ if (window->flags & SDL_WINDOW_OPENGL) { - wl_callback_add_listener(wl_surface_frame(data->surface), &surface_frame_listener, data); + data->frame_callback = wl_surface_frame(data->surface); + wl_callback_add_listener(data->frame_callback, &surface_frame_listener, data); } #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH