diff --git a/src/plugins/platforms/drm/drm_gpu.cpp b/src/plugins/platforms/drm/drm_gpu.cpp index 48b17f4881..4563db74d4 100644 --- a/src/plugins/platforms/drm/drm_gpu.cpp +++ b/src/plugins/platforms/drm/drm_gpu.cpp @@ -74,7 +74,9 @@ DrmGpu::~DrmGpu() eglTerminate(m_eglDisplay); } #if HAVE_GBM - gbm_device_destroy(m_gbmDevice); + if (m_gbmDevice) { + gbm_device_destroy(m_gbmDevice); + } #endif qDeleteAll(m_crtcs); qDeleteAll(m_connectors);