mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-08 12:28:04 +02:00
Fix simple-egl tear-down order to prevent a crash on exit time
wl_egl_window_destory() destroys the window handle that dri2_destroy_surface() later uses when eglTerminate() is called. Reordering the tear down order prevents such case from occuring.
This commit is contained in:
parent
2e43720743
commit
6ab1353195
1 changed files with 6 additions and 5 deletions
|
|
@ -146,11 +146,6 @@ init_egl(struct display *display, int opaque)
|
|||
static void
|
||||
fini_egl(struct display *display)
|
||||
{
|
||||
/* Required, otherwise segfault in egl_dri2.c: dri2_make_current()
|
||||
* on eglReleaseThread(). */
|
||||
eglMakeCurrent(display->egl.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE,
|
||||
EGL_NO_CONTEXT);
|
||||
|
||||
eglTerminate(display->egl.dpy);
|
||||
eglReleaseThread();
|
||||
}
|
||||
|
|
@ -330,6 +325,12 @@ create_surface(struct window *window)
|
|||
static void
|
||||
destroy_surface(struct window *window)
|
||||
{
|
||||
/* Required, otherwise segfault in egl_dri2.c: dri2_make_current()
|
||||
* on eglReleaseThread(). */
|
||||
eglMakeCurrent(window->display->egl.dpy, EGL_NO_SURFACE, EGL_NO_SURFACE,
|
||||
EGL_NO_CONTEXT);
|
||||
|
||||
eglDestroySurface(window->display->egl.dpy, window->egl_surface);
|
||||
wl_egl_window_destroy(window->native);
|
||||
|
||||
wl_shell_surface_destroy(window->shell_surface);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue