diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2021-04-01 00:12:00 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2021-04-01 11:28:44 +0300 |
commit | d171c7b3ba346c4d0bd6494f45ebf0be3c3cc5fb (patch) | |
tree | 6ad2af6e1f1c2dc265bf0314ea226038a1b60d25 | |
parent | 8df8532ee5ccfdbf807073139b06bc44733bb170 (diff) |
libweston/backend-drm: Re-order gbm destruction at DRM-backend tear down
Tearing down the drm-backend when there are no input devices, would call
for the gbm device destruction before compositor shutdown. The latter
would call into the renderer detroy function and assume that the
EGLDisplay, which was created using the before-mentioned gbm device, is
still available. This patch re-orders the gbm destruction after the
compositor shutdown when no one would make use of it.
Fixes: #314
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Daniel Stone <daniel.stone@collabora.com>
-rw-r--r-- | libweston/backend-drm/drm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index c780c1c1..abfcabd3 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -3203,10 +3203,6 @@ err_drm_source: err_udev_input: udev_input_destroy(&b->input); err_sprite: -#ifdef BUILD_DRM_GBM - if (b->gbm) - gbm_device_destroy(b->gbm); -#endif destroy_sprites(b); err_create_crtc_list: drmModeFreeResources(res); @@ -3218,6 +3214,10 @@ err_launcher: weston_launcher_destroy(compositor->launcher); err_compositor: weston_compositor_shutdown(compositor); +#ifdef BUILD_DRM_GBM + if (b->gbm) + gbm_device_destroy(b->gbm); +#endif free(b); return NULL; } |