Evas GL: Reset current surface for all contexts to null when surface is destroyed
authorDongyeon Kim <dy5.kim@samsung.com>
Mon, 11 Jan 2016 01:11:58 +0000 (10:11 +0900)
committerDongyeon Kim <dy5.kim@samsung.com>
Wed, 13 Jan 2016 00:05:56 +0000 (09:05 +0900)
When evas gl surface is destroyed, not only the current surface for the current context
should be set to NULL, but current surface for all contexts should be reset.

src/modules/evas/engines/gl_common/evas_gl_core.c

index ba3496a..f851d56 100644 (file)
@@ -2081,6 +2081,8 @@ int
 evgl_surface_destroy(void *eng_data, EVGL_Surface *sfc)
 {
    EVGL_Resource *rsc;
+   Eina_List *l;
+   EVGL_Context *ctx;
    Eina_Bool dbg;
 
    // Check input parameter
@@ -2183,6 +2185,12 @@ evgl_surface_destroy(void *eng_data, EVGL_Surface *sfc)
    evgl_engine->surfaces = eina_list_remove(evgl_engine->surfaces, sfc);
    LKU(evgl_engine->resource_lock);
 
+   EINA_LIST_FOREACH(evgl_engine->contexts, l, ctx)
+     {
+        if (ctx->current_sfc == sfc)
+          ctx->current_sfc = NULL;
+     }
+
    free(sfc);
 
    _surface_context_list_print();