diff --git a/src/SFML/Window/DRM/DRMContext.cpp b/src/SFML/Window/DRM/DRMContext.cpp index 99468e7da..e9485f9c5 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);