From 4acd1dcad41d154093ca14eb0adf35f4f99bd06a Mon Sep 17 00:00:00 2001 From: Vanfanel Date: Thu, 18 Mar 2021 14:04:38 +0100 Subject: [PATCH] [KMSDRM] Improve the way to test if last window is being destroyed. --- src/video/kmsdrm/SDL_kmsdrmvideo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/kmsdrm/SDL_kmsdrmvideo.c b/src/video/kmsdrm/SDL_kmsdrmvideo.c index 703b8768a..4e4569d58 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) {