summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2016-08-23 12:16:09 -0500
committerDerek Foreman <derekf@osg.samsung.com>2016-08-23 15:27:06 -0500
commitae83b96030206dd8dbdc6a0605ef4b7e850ddc93 (patch)
tree2ac20ded79dd621bfc32e6a7ad72e11776f159ff
parent5d527fffc82bb2d21d4b47a337fc96181cf7fd9e (diff)
wayland_egl: Destroy gl context if engine info updated with NULL wl_surface
We set the wayland surface to NULL in engine info, then destroy the wayland surface later. The GL stack tries to render to the destroyed surface and dies. If we destroy the GL surface when we set the engine info (before we destroy the wayland surface)it stops the GL stack from doing bad wayland calls. This fixes a crash on exit, or when any window closes when using mali GL drivers. Surprisingly, Mesa was tolerant of this.
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 9d4260dfa1..a85c593e6f 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -635,6 +635,16 @@ eng_setup(Evas *evas, void *info)
635 { 635 {
636 re = epd->engine.data.output; 636 re = epd->engine.data.output;
637 ob = eng_get_ob(re); 637 ob = eng_get_ob(re);
638
639 if (!inf->info.surface && (ob->egl_surface[0] != EGL_NO_SURFACE))
640 {
641 eglDestroySurface(ob->egl_disp, ob->egl_surface[0]);
642 eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
643 EGL_NO_CONTEXT);
644 ob->egl_surface[0] = EGL_NO_SURFACE;
645 return 1;
646 }
647
638 if ((ob) && (_re_wincheck(ob))) 648 if ((ob) && (_re_wincheck(ob)))
639 { 649 {
640 ob->info = inf; 650 ob->info = inf;