summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-02-25 14:58:19 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-02-25 15:01:45 +0900
commit964d6e559fc687b4d127ba2e9dffc346e239fa03 (patch)
tree05691f0c10f66c43680229062c5f200c01b98b6b
parent6d6fa6b7150a353ce2b88e9a9f71b6310423d310 (diff)
downloadefl-964d6e559fc687b4d127ba2e9dffc346e239fa03.tar.gz
Evas GL: Fix leak of surfaces with GLES 1.1
When destroying a GLES 1.1 surface, it is necessary to also destroy and remove the main surface from the list. This issue probably never really showed up because people don't: - use GLES 1.1 - constantly create & destroy new Evas GL surfaces - but mostly no one cares about 1.1 anymore :) @fix
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_core.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_core.c b/src/modules/evas/engines/gl_common/evas_gl_core.c
index d79e38fb48..757f4ba4d5 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_core.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_core.c
@@ -1648,6 +1648,7 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
{
if (!evgl_engine->funcs->gles1_surface_create)
{
+ ERR("Can't create GLES 1.1 surfaces");
evas_gl_common_error_set(eng_data, EVAS_GL_NOT_INITIALIZED);
goto error;
}
@@ -1710,6 +1711,8 @@ evgl_surface_create(void *eng_data, Evas_GL_Config *cfg, int w, int h)
if (dbg) DBG("Created surface sfc %p (eng %p)", sfc, eng_data);
+ _surface_context_list_print();
+
return sfc;
error:
@@ -1902,8 +1905,11 @@ evgl_surface_destroy(void *eng_data, EVGL_Surface *sfc)
DBG("Destroying special surface used for GLES 1.x rendering");
ret = evgl_engine->funcs->gles1_surface_destroy(eng_data, sfc);
- if (!ret) ERR("Engine failed to destroy a GLES1.x Surface.");
- return ret;
+ if (!ret)
+ {
+ ERR("Engine failed to destroy a GLES1.x Surface.");
+ return ret;
+ }
}
@@ -1968,6 +1974,8 @@ evgl_surface_destroy(void *eng_data, EVGL_Surface *sfc)
free(sfc);
sfc = NULL;
+ _surface_context_list_print();
+
return 1;
}
@@ -2279,6 +2287,8 @@ evgl_make_current(void *eng_data, EVGL_Surface *sfc, EVGL_Context *ctx)
// Update extensions after GLESv1 context is bound
evgl_api_gles1_ext_get(gles1_funcs);
+ _surface_context_list_print();
+
return 1;
}