summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortaehyub <taehyub.kim@samsung.com>2015-03-26 03:02:15 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-03-26 03:02:15 +0900
commit969d921f6ab4d04aa39d9abff71d1c402138369e (patch)
treee3aa4bf671340093c3f714a0e2954f0cca788310
parent2304de9d22527f5cf060bd50c8856b34c6fcf588 (diff)
downloadelementary-969d921f6ab4d04aa39d9abff71d1c402138369e.tar.gz
elc_popup: add null pointer check before creating content text object
Summary: If elm_object_text_set() function is called twice, elm_obj_containter_content_set(CONTENT_PART, sd->text_content_obj) function makes sd->text_content_obj null since sd->text_content_obj already exists. Test Plan: 1. run elementary_test(popup) and excute "popup-center-text + 1button (check hide, show)" 2. print sd->text_content_obj value in content_text_set() 3. push hide button and excute the example again 4. check sd->text_content_obj value if null or not Reviewers: woohyun, Hermet, raster Reviewed By: raster Differential Revision: https://phab.enlightenment.org/D2225
-rw-r--r--src/lib/elc_popup.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index e0fdd9c17..7fc04eb61 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -886,6 +886,13 @@ _content_text_set(Evas_Object *obj,
else eo_do(sd->main_layout, elm_obj_container_content_set(CONTENT_PART, sd->content_area));
if (!text) goto end;
+ if (sd->text_content_obj)
+ {
+ eo_do(sd->content_area, sd->text_content_obj = elm_obj_container_content_unset(CONTENT_PART));
+ evas_object_del(sd->text_content_obj);
+ sd->text_content_obj = NULL;
+ }
+
sd->text_content_obj = elm_label_add(sd->content_area);
snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj));
elm_object_style_set(sd->text_content_obj, style);