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>
This commit is contained in:
Srivardhan Hebbar 2015-02-05 11:26:58 +01:00 committed by Cedric BAIL
parent a9a027509c
commit a2d40968df
1 changed files with 12 additions and 6 deletions

View File

@ -194,16 +194,12 @@ ecore_con_init(void)
#endif
if (!ecore_init())
return --_ecore_con_init_count;
goto ecore_err;
_ecore_con_log_dom = eina_log_domain_register
("ecore_con", ECORE_CON_DEFAULT_LOG_COLOR);
if (_ecore_con_log_dom < 0)
{
EINA_LOG_ERR("Impossible to create a log domain for Ecore Con.");
ecore_shutdown();
return --_ecore_con_init_count;
}
goto ecore_con_log_error;
ecore_con_mempool_init();
@ -237,6 +233,16 @@ ecore_con_init(void)
EINA_LOG_STATE_INIT);
return _ecore_con_init_count;
ecore_con_log_error:
EINA_LOG_ERR("Failed to create a log domain for Ecore Con.");
ecore_shutdown();
ecore_err:
#ifdef HAVE_EVIL
evil_shutdown();
#endif
return --_ecore_con_init_count;
}
EAPI int