summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrivardhan Hebbar <sri.hebbar@samsung.com>2015-02-05 11:26:58 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-02-05 11:27:00 +0100
commita2d40968dfc9287ba39f0f02fb9bee97ec3b7370 (patch)
treed0aeec1a3836fc6521036610530a365b1e578649
parenta9a027509c0753ebb366143e6c3c37892c8991ed (diff)
Ecore_con: fix initialisation clean up and avoid memory leak.
Summary: When ecore_init failed or when failed to initialize ecore_con_log_domain, then evil_shutdown was not called. So cleaned up code and added the fix. @fix Reviewers: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1921 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/ecore_con/ecore_con.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c
index 7ad692b706..a21e6df8b4 100644
--- a/src/lib/ecore_con/ecore_con.c
+++ b/src/lib/ecore_con/ecore_con.c
@@ -194,16 +194,12 @@ ecore_con_init(void)
194#endif 194#endif
195 195
196 if (!ecore_init()) 196 if (!ecore_init())
197 return --_ecore_con_init_count; 197 goto ecore_err;
198 198
199 _ecore_con_log_dom = eina_log_domain_register 199 _ecore_con_log_dom = eina_log_domain_register
200 ("ecore_con", ECORE_CON_DEFAULT_LOG_COLOR); 200 ("ecore_con", ECORE_CON_DEFAULT_LOG_COLOR);
201 if (_ecore_con_log_dom < 0) 201 if (_ecore_con_log_dom < 0)
202 { 202 goto ecore_con_log_error;
203 EINA_LOG_ERR("Impossible to create a log domain for Ecore Con.");
204 ecore_shutdown();
205 return --_ecore_con_init_count;
206 }
207 203
208 ecore_con_mempool_init(); 204 ecore_con_mempool_init();
209 205
@@ -237,6 +233,16 @@ ecore_con_init(void)
237 EINA_LOG_STATE_INIT); 233 EINA_LOG_STATE_INIT);
238 234
239 return _ecore_con_init_count; 235 return _ecore_con_init_count;
236
237ecore_con_log_error:
238 EINA_LOG_ERR("Failed to create a log domain for Ecore Con.");
239 ecore_shutdown();
240
241ecore_err:
242#ifdef HAVE_EVIL
243 evil_shutdown();
244#endif
245 return --_ecore_con_init_count;
240} 246}
241 247
242EAPI int 248EAPI int