Skip to content

backend-drm/drm-gbm: gbm_device_destroy on an invalid gbm device

Marius Vlad requested to merge mvlad/weston:wip/mvlad/gbm-destroy-twice into main

When EGL initialization fails (failure to create a GLES3 or GLES2 context) we will end up calling gbm_device_destroy() twice, once in init_egl() and once in the drm_backend_create() error path.

Given that we should also take care of properly destroying the gbm device when we don't have any inputs for instance, mark the gbm device as NULL to avoid calling gbm_device_destroy() once more when destroying the DRM-backend.

Signed-off-by: Marius Vlad marius.vlad@collabora.com

Edited by Marius Vlad

Merge request reports