Commit 4acd1dcad41d154093ca14eb0adf35f4f99bd06a

Vanfanel 2021-03-18T14:04:38

[KMSDRM] Improve the way to test if last window is being destroyed.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c
index 703b876..4e4569d 100644
--- a/src/video/kmsdrm/SDL_kmsdrmvideo.c
+++ b/src/video/kmsdrm/SDL_kmsdrmvideo.c
@@ -1088,7 +1088,7 @@ KMSDRM_DestroyWindow(_THIS, SDL_Window *window)
         KMSDRM_DestroySurfaces(_this, window);
 
         /* Unload library and deinit GBM, but only if this is the last remaining window.*/
-        if (viddata->num_windows < 2) {
+        if ((viddata->num_windows - 1) == 0) {
 
 	    /* Unload EGL/GL library and free egl_data.  */
 	    if (_this->egl_data) {