浏览代码

kmsdrm: On VideoQuit(), only destroy dumb buffer if it exists.

Manuel Alfayate Corchete 5 年之前
父节点
当前提交
351219bfd8
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/video/kmsdrm/SDL_kmsdrmvideo.c

+ 4 - 2
src/video/kmsdrm/SDL_kmsdrmvideo.c

@@ -1447,9 +1447,11 @@ KMSDRM_VideoQuit(_THIS)
         SDL_SetError("Failed to issue atomic commit on DestroyWindow().");
         SDL_SetError("Failed to issue atomic commit on DestroyWindow().");
     }
     }
 
 
-    /* Destroy the DUMB buffer, now that it's not being
+    /* Destroy the DUMB buffer if it exists, now that it's not being
        used anymore by the PRIMARY PLANE. */
        used anymore by the PRIMARY PLANE. */
-    KMSDRM_DestroyDumbBuffer(_this, dispdata->dumb_buffer);
+    if (dispdata->dumb_buffer) {
+        KMSDRM_DestroyDumbBuffer(_this, dispdata->dumb_buffer);
+    }
 
 
     /***************/
     /***************/
     /* BLOCK ENDS. */
     /* BLOCK ENDS. */