summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubhransu Mohanty <smohantty@gmail.com>2020-06-03 13:03:39 +0900
committerStefan Schmidt <s.schmidt@samsung.com>2020-06-15 15:39:54 +0200
commitc904970ad3eba93aa7a59e912c54fa54bbfeb796 (patch)
tree434e3f91839d5c5585e89769e57a74936f5a0095
parent709f31ebe86f24820ba6e26559d70c4106279854 (diff)
evas/engine: Fix memory leak in generic cache.
Summary: During shutdown we used to call engine_image_free() which was causing some deadlock. as we have evas_cache which takes care of freeing all the images we just have to delete the generic cache without freeing the image during shutdown. Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11915
-rw-r--r--src/lib/evas/common/evas_common_generic_cache.c13
-rw-r--r--src/modules/evas/engines/gl_generic/evas_engine.c3
2 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/evas/common/evas_common_generic_cache.c b/src/lib/evas/common/evas_common_generic_cache.c
index ddb055deb2..4fc5a8bbac 100644
--- a/src/lib/evas/common/evas_common_generic_cache.c
+++ b/src/lib/evas/common/evas_common_generic_cache.c
@@ -14,8 +14,17 @@ generic_cache_new(void *user_data, Generic_Cache_Free func)
14EAPI void 14EAPI void
15generic_cache_destroy(Generic_Cache *cache) 15generic_cache_destroy(Generic_Cache *cache)
16{ 16{
17 generic_cache_dump(cache); 17 Generic_Cache_Entry *entry;
18 eina_hash_free(cache->hash); 18 if (cache)
19 {
20 EINA_LIST_FREE(cache->lru_list, entry)
21 {
22 free(entry);
23 }
24
25 eina_hash_free(cache->hash);
26 free(cache);
27 }
19} 28}
20 29
21EAPI void 30EAPI void
diff --git a/src/modules/evas/engines/gl_generic/evas_engine.c b/src/modules/evas/engines/gl_generic/evas_engine.c
index d51a8ea1c7..8b9ef94d1b 100644
--- a/src/modules/evas/engines/gl_generic/evas_engine.c
+++ b/src/modules/evas/engines/gl_generic/evas_engine.c
@@ -167,8 +167,7 @@ eng_engine_free(void *engine)
167 Render_Engine_GL_Generic *e = engine; 167 Render_Engine_GL_Generic *e = engine;
168 Render_Output_GL_Generic *output; 168 Render_Output_GL_Generic *output;
169 169
170 //@FIXME this causes some deadlock while freeing the engine image. 170 generic_cache_destroy(e->software.surface_cache);
171 //generic_cache_destroy(e->software.surface_cache);
172 171
173 EINA_LIST_FREE(e->software.outputs, output) 172 EINA_LIST_FREE(e->software.outputs, output)
174 ERR("Output %p not properly cleaned before engine destruction.", output); 173 ERR("Output %p not properly cleaned before engine destruction.", output);