Prevent 372807
authorSung-jae Park <nicesj.park@samsung.com>
Tue, 12 May 2015 14:40:55 +0000 (23:40 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 12 May 2015 14:40:55 +0000 (23:40 +0900)
Change-Id: Ifbf008aef692bf6a48c44b08e1bd6f54bb23959a

src/script_port.c

index e3e7a5f..426cc3d 100644 (file)
@@ -1408,6 +1408,7 @@ PUBLIC int script_update_script(void *h, const char *src_id, const char *target_
        Evas_Object *edje;
        Evas_Object *obj;
        struct obj_info *obj_info;
+       struct obj_info *parent_obj_info;
        struct child *child;
        char _target_id[32];
 
@@ -1417,8 +1418,8 @@ PUBLIC int script_update_script(void *h, const char *src_id, const char *target_
                return WIDGET_ERROR_NOT_EXIST;
        }
 
-       obj_info = evas_object_data_get(edje, "obj_info");
-       if (!obj_info) {
+       parent_obj_info = evas_object_data_get(edje, "obj_info");
+       if (!parent_obj_info) {
                ErrPrint("Object info is not valid\n");
                return WIDGET_ERROR_INVALID_PARAMETER;
        }
@@ -1533,20 +1534,7 @@ PUBLIC int script_update_script(void *h, const char *src_id, const char *target_
        DbgPrint("%s part swallow edje %p\n", part, obj);
        elm_object_part_content_set(edje, part, obj);
 
-       obj_info = evas_object_data_get(edje, "obj_info");
-
-       if (obj_info == NULL) {
-               ErrPrint("evas_object_data_get failed\n");
-               free(child->part);
-               free(child);
-               free(obj_info->id);
-               free(obj_info);
-               evas_object_del(obj);
-               return WIDGET_ERROR_FAULT;
-       }
-
-       obj_info->children = eina_list_append(obj_info->children, child);
-
+       parent_obj_info->children = eina_list_append(parent_obj_info->children, child);
        return WIDGET_ERROR_NONE;
 }