mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-03-22 23:35:05 +00:00
Fixed memory leak when removing existing displays
This commit is contained in:
parent
8b74be464f
commit
cfc7cac3c9
|
@ -640,6 +640,7 @@ void SDL_DelVideoDisplay(int index)
|
|||
SDL_SendDisplayEvent(&_this->displays[index], SDL_DISPLAYEVENT_DISCONNECTED, 0);
|
||||
|
||||
if (index < (_this->num_displays - 1)) {
|
||||
SDL_free(_this->displays[index].driverdata);
|
||||
SDL_memmove(&_this->displays[index], &_this->displays[index + 1], (_this->num_displays - index - 1) * sizeof(_this->displays[index]));
|
||||
}
|
||||
--_this->num_displays;
|
||||
|
|
Loading…
Reference in a new issue