diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 26d254ffc..ffc69cdc2 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -828,6 +828,9 @@ void SDL_SetCurrentDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode) { + if (display->desktop_mode.driverdata) { + SDL_free(display->desktop_mode.driverdata); + } SDL_memcpy(&display->desktop_mode, mode, sizeof(*mode)); }