gl-renderer: gl_renderer_create display cleanup on error
Clean up display connection via eglTerminate() in case of EGL initialisation error. Signed-off-by: Dawid Gajownik <gajownik@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
committed by
Pekka Paalanen
parent
89c49b3060
commit
1a912a9fe3
+3
-1
@@ -2649,7 +2649,7 @@ gl_renderer_create(struct weston_compositor *ec, EGLenum platform,
|
|||||||
if (egl_choose_config(gr, attribs, visual_id,
|
if (egl_choose_config(gr, attribs, visual_id,
|
||||||
n_ids, &gr->egl_config) < 0) {
|
n_ids, &gr->egl_config) < 0) {
|
||||||
weston_log("failed to choose EGL config\n");
|
weston_log("failed to choose EGL config\n");
|
||||||
goto fail;
|
goto fail_terminate;
|
||||||
}
|
}
|
||||||
|
|
||||||
ec->renderer = &gr->base;
|
ec->renderer = &gr->base;
|
||||||
@@ -2672,6 +2672,8 @@ gl_renderer_create(struct weston_compositor *ec, EGLenum platform,
|
|||||||
|
|
||||||
fail_with_error:
|
fail_with_error:
|
||||||
gl_renderer_print_egl_error_state();
|
gl_renderer_print_egl_error_state();
|
||||||
|
fail_terminate:
|
||||||
|
eglTerminate(gr->egl_display);
|
||||||
fail:
|
fail:
|
||||||
free(gr);
|
free(gr);
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user