mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-20 08:41:45 +00:00
video: Fixed small memory leak when disconnecting a display.
This commit is contained in:
@@ -644,6 +644,7 @@ void SDL_DelVideoDisplay(int index)
|
|||||||
|
|
||||||
if (index < (_this->num_displays - 1)) {
|
if (index < (_this->num_displays - 1)) {
|
||||||
SDL_free(_this->displays[index].driverdata);
|
SDL_free(_this->displays[index].driverdata);
|
||||||
|
SDL_free(_this->displays[index].name);
|
||||||
SDL_memmove(&_this->displays[index], &_this->displays[index + 1], (_this->num_displays - index - 1) * sizeof(_this->displays[index]));
|
SDL_memmove(&_this->displays[index], &_this->displays[index + 1], (_this->num_displays - index - 1) * sizeof(_this->displays[index]));
|
||||||
}
|
}
|
||||||
--_this->num_displays;
|
--_this->num_displays;
|
||||||
|
Reference in New Issue
Block a user