Fixed a memory leak at window creation.
Windows updates the desktop display mode once at video init (in WIN_InitModes()) and once when creating a window (in WIN_RefreshDisplays()) Fixes https://github.com/libsdl-org/SDL/issues/7982 Fixes https://github.com/libsdl-org/SDL/issues/8189main
parent
b5347c3364
commit
bea34c5380
|
@ -1164,6 +1164,9 @@ const SDL_DisplayMode *SDL_GetClosestFullscreenDisplayMode(SDL_DisplayID display
|
|||
|
||||
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));
|
||||
display->desktop_mode.displayID = display->id;
|
||||
SDL_FinalizeDisplayMode(&display->desktop_mode);
|
||||
|
|
Loading…
Reference in New Issue