Fix Wayland_DestroyWindow SEGFAULT

Check if the wind pointer is NULL, to avoid SEGFAULT.
Already implemented in SDL3, but not yet backported.
This commit is contained in:
hexnet1234
2026-02-20 18:41:55 +01:00
committed by Frank Praznik
parent cf5dabd6ea
commit 99ecc409cf

View File

@@ -2292,7 +2292,7 @@ void Wayland_DestroyWindow(_THIS, SDL_Window *window)
SDL_VideoData *data = _this->driverdata;
SDL_WindowData *wind = window->driverdata;
if (data) {
if (data && wind) {
#ifdef SDL_VIDEO_OPENGL_EGL
if (wind->egl_surface) {
SDL_EGL_DestroySurface(_this, wind->egl_surface);