diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2018-07-26 21:30:03 +0900 |
---|---|---|
committer | Hermet Park <hermetpark@gmail.com> | 2018-07-26 21:30:03 +0900 |
commit | 67f50eb5d6f36c9d21dd7edc873bcc675227ca95 (patch) | |
tree | 4e9abe27ac81272d1c5e8df448a2fda11de9d86c | |
parent | 69fdec545e527a03c462dfc285a50a77e296fc12 (diff) | |
download | efl-67f50eb5d6f36c9d21dd7edc873bcc675227ca95.tar.gz |
edje: handle all failure cases with error messages in init
Summary:
fix T7025
Depends on D6677
Reviewers: Hermet
Reviewed By: Hermet
Subscribers: cedric, #committers
Tags: #efl
Maniphest Tasks: T7025
Differential Revision: https://phab.enlightenment.org/D6678
-rw-r--r-- | src/lib/edje/edje_main.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c index bd49820179..0f669a01fa 100644 --- a/src/lib/edje/edje_main.c +++ b/src/lib/edje/edje_main.c @@ -41,8 +41,7 @@ edje_init(void) srand(time(NULL)); - if (!eina_init()) - return --_edje_init_count; + EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_init(), --_edje_init_count); _edje_default_log_dom = eina_log_domain_register ("edje", EDJE_DEFAULT_LOG_COLOR); @@ -84,11 +83,10 @@ edje_init(void) _edje_scale = FROM_DOUBLE(1.0); _edje_global_obj = efl_add(EDJE_GLOBAL_CLASS, efl_main_loop_get()); - if (!_edje_global_obj || - !efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj) || - !efl_loop_register(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj) || - !efl_loop_register(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj)) - goto shutdown_efreet; + EINA_SAFETY_ON_TRUE_GOTO(!_edje_global_obj, shutdown_efreet); + EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet); + EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet); + EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet); _edje_edd_init(); _edje_text_init(); @@ -119,7 +117,9 @@ edje_init(void) } _edje_calc_params_map_cow = eina_cow_add("Edje Calc Params Map", sizeof (Edje_Calc_Params_Map), 8, &default_calc_map, EINA_TRUE); + EINA_SAFETY_ON_NULL_GOTO(_edje_calc_params_map_cow, shutdown_all); _edje_calc_params_physics_cow = eina_cow_add("Edje Calc Params Physics", sizeof (Edje_Calc_Params_Physics), 8, &default_calc_physics, EINA_TRUE); + EINA_SAFETY_ON_NULL_GOTO(_edje_calc_params_physics_cow, shutdown_all); _edje_language = eina_stringshare_add(getenv("LANGUAGE")); @@ -135,6 +135,10 @@ edje_init(void) return _edje_init_count; shutdown_all: + eina_cow_del(_edje_calc_params_map_cow); + eina_cow_del(_edje_calc_params_physics_cow); + _edje_calc_params_map_cow = NULL; + _edje_calc_params_physics_cow = NULL; eina_mempool_del(_edje_real_part_state_mp); eina_mempool_del(_edje_real_part_mp); _edje_real_part_state_mp = NULL; |