summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2019-04-24 14:44:19 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2019-04-24 14:44:19 +0900
commitcf4854effbc94c53c25365ec4a3d794dff97c16b (patch)
tree8e7e0b5ad6a348bfa198bbadfc0160a4a4297478
parent808df5ecc229455580685fbe2dac7ab100a092d1 (diff)
efl_ui_stack: handle memory allocation fail
check if memory allocation succeeds and handle memory allocation fail.
-rw-r--r--src/lib/elementary/efl_ui_stack.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_stack.c b/src/lib/elementary/efl_ui_stack.c
index e7edcdaf57..c330fada92 100644
--- a/src/lib/elementary/efl_ui_stack.c
+++ b/src/lib/elementary/efl_ui_stack.c
@@ -162,6 +162,15 @@ _show_content_with_anim(Efl_Ui_Stack *obj, Efl_Ui_Stack_Data *pd, Content_Data *
162 efl_animation_player_target_set(pd->show, cd->content); 162 efl_animation_player_target_set(pd->show, cd->content);
163 163
164 Transit_Data *td = calloc(1, sizeof(Transit_Data)); 164 Transit_Data *td = calloc(1, sizeof(Transit_Data));
165 if (!td)
166 {
167 ERR("Memory allocation error!");
168
169 //show content without animation
170 _show_content_without_anim(obj, cd->content);
171 return;
172 }
173
165 td->cd = cd; 174 td->cd = cd;
166 pd->show_td = td; 175 pd->show_td = td;
167 176
@@ -185,6 +194,15 @@ _hide_content_with_anim(Efl_Ui_Stack *obj EINA_UNUSED, Efl_Ui_Stack_Data *pd, Co
185 efl_animation_player_target_set(pd->hide, cd->content); 194 efl_animation_player_target_set(pd->hide, cd->content);
186 195
187 Transit_Data *td = calloc(1, sizeof(Transit_Data)); 196 Transit_Data *td = calloc(1, sizeof(Transit_Data));
197 if (!td)
198 {
199 ERR("Memory allocation error!");
200
201 //hide content without animation
202 _hide_content_without_anim(obj, cd->content);
203 return;
204 }
205
188 td->cd = cd; 206 td->cd = cd;
189 pd->hide_td = td; 207 pd->hide_td = td;
190 208