浏览代码

free the 'display' after it was added to global list

Christian Rauch 4 年之前
父节点
当前提交
4183211a54
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/video/wayland/SDL_waylandvideo.c

+ 4 - 0
src/video/wayland/SDL_waylandvideo.c

@@ -297,6 +297,10 @@ display_handle_done(void *data,
 
     SDL_AddVideoDisplay(display, SDL_FALSE);
     SDL_free(display->name);
+    /* The 'display' content was copied in previous SDL_AddVideoDisplay call.
+     * We have to remove this reference, else it will be lost indefinitely.
+     */
+    SDL_free(display);
 }
 
 static void