mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-10 12:35:17 +00:00
[KMSDRM] Unload GL/EGL libs and destroy GBM only when we are destroying the last window.
This commit is contained in:
@@ -1087,6 +1087,9 @@ KMSDRM_DestroyWindow(_THIS, SDL_Window *window)
|
|||||||
/* Destroy GBM surface and buffers. */
|
/* Destroy GBM surface and buffers. */
|
||||||
KMSDRM_DestroySurfaces(_this, window);
|
KMSDRM_DestroySurfaces(_this, window);
|
||||||
|
|
||||||
|
/* Unload library and deinit GBM, but only if this is the last remaining window.*/
|
||||||
|
if (viddata->num_windows < 2) {
|
||||||
|
|
||||||
/* Unload EGL/GL library and free egl_data. */
|
/* Unload EGL/GL library and free egl_data. */
|
||||||
if (_this->egl_data) {
|
if (_this->egl_data) {
|
||||||
SDL_EGL_UnloadLibrary(_this);
|
SDL_EGL_UnloadLibrary(_this);
|
||||||
@@ -1095,6 +1098,7 @@ KMSDRM_DestroyWindow(_THIS, SDL_Window *window)
|
|||||||
|
|
||||||
/* Free display plane, and destroy GBM device. */
|
/* Free display plane, and destroy GBM device. */
|
||||||
KMSDRM_GBMDeinit(_this, dispdata);
|
KMSDRM_GBMDeinit(_this, dispdata);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user