Browse Source

video: Fixed small memory leak when disconnecting a display.

Ryan C. Gordon 2 năm trước cách đây
mục cha
commit
9237f8edc1
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      src/video/SDL_video.c

+ 1 - 0
src/video/SDL_video.c

@@ -644,6 +644,7 @@ void SDL_DelVideoDisplay(int index)
 
     if (index < (_this->num_displays - 1)) {
         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]));
     }
     --_this->num_displays;