forked from enlightenment/efl
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
This commit is contained in:
parent
c361c9e839
commit
d48b15b2fd
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue