derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=ae83b96030206dd8dbdc6a0605ef4b7e850ddc93

commit ae83b96030206dd8dbdc6a0605ef4b7e850ddc93
Author: Derek Foreman <[email protected]>
Date:   Tue Aug 23 12:16:09 2016 -0500

    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.
---
 src/modules/evas/engines/wayland_egl/evas_engine.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c 
b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 9d4260d..a85c593 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)
      {
         re = epd->engine.data.output;
         ob = eng_get_ob(re);
+
+        if (!inf->info.surface && (ob->egl_surface[0] != EGL_NO_SURFACE))
+          {
+             eglDestroySurface(ob->egl_disp, ob->egl_surface[0]);
+             eglMakeCurrent(ob->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
+                            EGL_NO_CONTEXT);
+             ob->egl_surface[0] = EGL_NO_SURFACE;
+             return 1;
+          }
+
         if ((ob) && (_re_wincheck(ob)))
           {
              ob->info = inf;

-- 


Reply via email to