mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 07:35:38 +00:00
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/8189 (cherry picked from commit bea34c53804ada8d90c94aba27262635513452d3)
This commit is contained in:
parent
925362a2fc
commit
0ec1209eab
|
@ -828,6 +828,9 @@ void SDL_SetCurrentDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode
|
||||||
|
|
||||||
void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode *mode)
|
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));
|
SDL_memcpy(&display->desktop_mode, mode, sizeof(*mode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue