derekf pushed a commit to branch master.

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

commit 49e7932c8670a2977fe80860a9112abab16e9237
Author: Derek Foreman <[email protected]>
Date:   Fri Mar 3 12:45:58 2017 -0600

    gl_generic: Add null checks in some cache functions
    
    When wayland session recovery happens, we can end up down this path
    with no gl context when elm reprocesses its config file.
    
    That callback fires long before we've re-set up our wayland connection
    so we can't possibly have a valid gl context yet.
    
    Prevent that from crashing.
---
 src/modules/evas/engines/gl_generic/evas_engine.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c 
b/src/modules/evas/engines/gl_generic/evas_engine.c
index d0c179e..4fdcced 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -1399,6 +1399,7 @@ eng_image_cache_flush(void *data)
 
    re->window_use(re->software.ob);
    gl_context = re->window_gl_context_get(re->software.ob);
+   if (!gl_context) return;
 
    tmp_size = evas_common_image_get_cache();
    evas_common_image_set_cache(0);
@@ -1418,7 +1419,7 @@ eng_image_cache_set(void *data, int bytes)
 
    evas_common_image_set_cache(bytes);
    evas_common_rgba_image_scalecache_size_set(bytes);
-   evas_gl_common_image_cache_flush(gl_context);
+   if (gl_context) evas_gl_common_image_cache_flush(gl_context);
 }
 
 static int

-- 


Reply via email to