elm_config.c: ELM_SAFE_FREE adoption.

I splited ELM_SAFE_FREE refactoring patches. One commit per each file as recommended.
For the detail, please refer 3072dab12f12fe83fb5a628d15efd5cded11787f.
This commit is contained in:
Daniel Juyung Seo 2013-05-29 20:49:54 +09:00
parent 1045cab8a7
commit 6f65981864
1 changed files with 11 additions and 21 deletions

View File

@ -246,13 +246,13 @@ _prop_change(void *data __UNUSED__,
{
if (event->atom == _atom[ATOM_E_PROFILE])
{
ELM_FREE_FUNC(_prop_change_delay_timer, ecore_timer_del);
if (_prop_change_delay_timer) ecore_timer_del(_prop_change_delay_timer);
_prop_change_delay_timer = ecore_timer_add(0.1, _prop_change_delay_cb, NULL);
}
else if (((_atom_config > 0) && (event->atom == _atom_config)) ||
(event->atom == _atom[ATOM_E_CONFIG]))
{
ELM_FREE_FUNC(_prop_change_delay_timer, ecore_timer_del);
if (_prop_change_delay_timer) ecore_timer_del(_prop_change_delay_timer);
_prop_change_delay_timer = ecore_timer_add(0.1, _prop_change_delay_cb, NULL);
}
}
@ -2363,7 +2363,7 @@ EAPI void
elm_config_all_flush(void)
{
#ifdef HAVE_ELEMENTARY_X
ELM_FREE_FUNC(_prop_all_update_timer, ecore_timer_del);
if (_prop_all_update_timer) ecore_timer_del(_prop_all_update_timer);
_prop_all_update_timer = ecore_timer_add(0.1, _prop_all_update_cb, NULL);
#endif
}
@ -2404,8 +2404,7 @@ _elm_config_init(void)
_profile_fetch_from_conf();
_config_load();
_env_get();
if (_elm_preferred_engine) eina_stringshare_del(_elm_preferred_engine);
_elm_preferred_engine = NULL;
ELM_SAFE_FREE(_elm_preferred_engine, eina_stringshare_del);
_translation_init();
_config_apply();
_elm_config_font_overlay_apply();
@ -2419,10 +2418,11 @@ _elm_config_sub_shutdown(void)
#ifdef HAVE_ELEMENTARY_X
if (_prop_all_update_timer)
{
ELM_FREE_FUNC(_prop_all_update_timer, ecore_timer_del);
ecore_timer_del(_prop_all_update_timer);
_prop_all_update_timer = NULL;
_prop_all_update_cb(NULL);
}
ELM_FREE_FUNC(_prop_change_delay_timer, ecore_timer_del);
ELM_SAFE_FREE(_prop_change_delay_timer, ecore_timer_del);
#endif
#define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
@ -2526,8 +2526,7 @@ elm_config_preferred_engine_set(const char *engine)
eina_stringshare_replace(&(_elm_preferred_engine), engine);
else
{
if (_elm_preferred_engine) eina_stringshare_del(_elm_preferred_engine);
_elm_preferred_engine = NULL;
ELM_SAFE_FREE(_elm_preferred_engine, eina_stringshare_del);
}
}
@ -2591,18 +2590,9 @@ _elm_config_shutdown(void)
_prop_change_handler = NULL;
#endif
}
_config_free(_elm_config);
_elm_config = NULL;
if (_elm_preferred_engine)
{
eina_stringshare_del(_elm_preferred_engine);
_elm_preferred_engine = NULL;
}
if (_elm_profile)
{
free(_elm_profile);
_elm_profile = NULL;
}
ELM_SAFE_FREE(_elm_config, _config_free);
ELM_SAFE_FREE(_elm_preferred_engine, eina_stringshare_del);
ELM_SAFE_FREE(_elm_profile, free);
#ifdef HAVE_ELEMENTARY_X
_elm_font_overlays_del_free();