From 347b306d21d6e681ec4e86f33c5b407a508c0006 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Sat, 4 Feb 2023 17:34:15 -0700 Subject: [PATCH] Don't terminate DRM display if it's null --- src/SFML/Window/DRM/DRMContext.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SFML/Window/DRM/DRMContext.cpp b/src/SFML/Window/DRM/DRMContext.cpp index 99468e7d..e9485f9c 100644 --- a/src/SFML/Window/DRM/DRMContext.cpp +++ b/src/SFML/Window/DRM/DRMContext.cpp @@ -112,7 +112,8 @@ void cleanup() drmModeFreeEncoder(drmNode.savedEncoder); drmModeFreeCrtc(drmNode.originalCrtc); - eglTerminate(display); + if (display != EGL_NO_DISPLAY) + eglTerminate(display); display = EGL_NO_DISPLAY; gbm_device_destroy(gbmDevice);