mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
render/egl: introduce wlr_egl_unset_current
This function can be called after wlr_egl_make_current to cleanup the EGL context. This avoids having lingering EGL contexts that make things work by chance. Closes: https://github.com/swaywm/wlroots/issues/2197
This commit is contained in:
parent
781ed1ff02
commit
1edc42157b
8 changed files with 62 additions and 29 deletions
|
|
@ -401,6 +401,8 @@ static void gles2_destroy(struct wlr_renderer *wlr_renderer) {
|
|||
gles2_procs.glDebugMessageCallbackKHR(NULL, NULL);
|
||||
}
|
||||
|
||||
wlr_egl_unset_current(renderer->egl);
|
||||
|
||||
free(renderer);
|
||||
}
|
||||
|
||||
|
|
@ -670,6 +672,8 @@ struct wlr_renderer *wlr_gles2_renderer_create(struct wlr_egl *egl) {
|
|||
|
||||
POP_GLES2_DEBUG;
|
||||
|
||||
wlr_egl_unset_current(renderer->egl);
|
||||
|
||||
return &renderer->wlr_renderer;
|
||||
|
||||
error:
|
||||
|
|
@ -686,6 +690,8 @@ error:
|
|||
gles2_procs.glDebugMessageCallbackKHR(NULL, NULL);
|
||||
}
|
||||
|
||||
wlr_egl_unset_current(renderer->egl);
|
||||
|
||||
free(renderer);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue