summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-26 21:30:03 +0900
committerHermet Park <hermetpark@gmail.com>2018-07-26 21:30:03 +0900
commit67f50eb5d6f36c9d21dd7edc873bcc675227ca95 (patch)
tree4e9abe27ac81272d1c5e8df448a2fda11de9d86c
parent69fdec545e527a03c462dfc285a50a77e296fc12 (diff)
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.c18
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)
41 41
42 srand(time(NULL)); 42 srand(time(NULL));
43 43
44 if (!eina_init()) 44 EINA_SAFETY_ON_FALSE_RETURN_VAL(eina_init(), --_edje_init_count);
45 return --_edje_init_count;
46 45
47 _edje_default_log_dom = eina_log_domain_register 46 _edje_default_log_dom = eina_log_domain_register
48 ("edje", EDJE_DEFAULT_LOG_COLOR); 47 ("edje", EDJE_DEFAULT_LOG_COLOR);
@@ -84,11 +83,10 @@ edje_init(void)
84 83
85 _edje_scale = FROM_DOUBLE(1.0); 84 _edje_scale = FROM_DOUBLE(1.0);
86 _edje_global_obj = efl_add(EDJE_GLOBAL_CLASS, efl_main_loop_get()); 85 _edje_global_obj = efl_add(EDJE_GLOBAL_CLASS, efl_main_loop_get());
87 if (!_edje_global_obj || 86 EINA_SAFETY_ON_TRUE_GOTO(!_edje_global_obj, shutdown_efreet);
88 !efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj) || 87 EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet);
89 !efl_loop_register(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj) || 88 EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet);
90 !efl_loop_register(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj)) 89 EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet);
91 goto shutdown_efreet;
92 90
93 _edje_edd_init(); 91 _edje_edd_init();
94 _edje_text_init(); 92 _edje_text_init();
@@ -119,7 +117,9 @@ edje_init(void)
119 } 117 }
120 118
121 _edje_calc_params_map_cow = eina_cow_add("Edje Calc Params Map", sizeof (Edje_Calc_Params_Map), 8, &default_calc_map, EINA_TRUE); 119 _edje_calc_params_map_cow = eina_cow_add("Edje Calc Params Map", sizeof (Edje_Calc_Params_Map), 8, &default_calc_map, EINA_TRUE);
120 EINA_SAFETY_ON_NULL_GOTO(_edje_calc_params_map_cow, shutdown_all);
122 _edje_calc_params_physics_cow = eina_cow_add("Edje Calc Params Physics", sizeof (Edje_Calc_Params_Physics), 8, &default_calc_physics, EINA_TRUE); 121 _edje_calc_params_physics_cow = eina_cow_add("Edje Calc Params Physics", sizeof (Edje_Calc_Params_Physics), 8, &default_calc_physics, EINA_TRUE);
122 EINA_SAFETY_ON_NULL_GOTO(_edje_calc_params_physics_cow, shutdown_all);
123 123
124 _edje_language = eina_stringshare_add(getenv("LANGUAGE")); 124 _edje_language = eina_stringshare_add(getenv("LANGUAGE"));
125 125
@@ -135,6 +135,10 @@ edje_init(void)
135 return _edje_init_count; 135 return _edje_init_count;
136 136
137shutdown_all: 137shutdown_all:
138 eina_cow_del(_edje_calc_params_map_cow);
139 eina_cow_del(_edje_calc_params_physics_cow);
140 _edje_calc_params_map_cow = NULL;
141 _edje_calc_params_physics_cow = NULL;
138 eina_mempool_del(_edje_real_part_state_mp); 142 eina_mempool_del(_edje_real_part_state_mp);
139 eina_mempool_del(_edje_real_part_mp); 143 eina_mempool_del(_edje_real_part_mp);
140 _edje_real_part_state_mp = NULL; 144 _edje_real_part_state_mp = NULL;