summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--video/out/opengl/context_drm_egl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c
index ce86570efe..da28093562 100644
--- a/video/out/opengl/context_drm_egl.c
+++ b/video/out/opengl/context_drm_egl.c
@@ -491,7 +491,8 @@ static void drm_egl_uninit(struct ra_ctx *ctx)
if (p->gbm.surface)
gbm_surface_destroy(p->gbm.surface);
eglTerminate(p->egl.display);
- gbm_device_destroy(p->gbm.device);
+ if (p->gbm.device)
+ gbm_device_destroy(p->gbm.device);
if (p->drm_params.render_fd != -1)
close(p->drm_params.render_fd);