object_info->type = calloc(1, strlen("swallow") + 1);
if (!object_info->type) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->type, "swallow", strlen("swallow") + 1);
} else if (evas_object_type_match(obj, "rectangle")) {
object_info->type = calloc(1, strlen("rect") + 1);
if (!object_info->type) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->type, "rect", strlen("rect") + 1);
evas_object_color_get(obj, &r, &g, &b, &a);
object_info->type = calloc(1, strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
if (!object_info->type) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->type, EVAS_OBJECT_TYPE_GET(obj), strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
}
object_info->group = calloc(1, strlen(group) + 1);
if (!object_info->group) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->group, group, strlen(group) + 1);
}
object_info->color_class = calloc(1, strlen(edje_info->color_class) + 1);
if (!object_info->color_class) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1);
}
object_info->part_state = calloc(1, strlen(ret) + 1);
if (!object_info->part_name || !object_info->part_state) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1);
strncpy(object_info->part_state, ret, strlen(ret) + 1);
object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1);
if (!object_info->image_name) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->image_name, edje_info->image_name, strlen(edje_info->image_name) + 1);
}
object_info->text = calloc(1, strlen(text) + 1);
if (!object_info->text) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->text, text, strlen(text) + 1);
}
EINA_LIST_FREE(children, child)
_obj_tree_items(util_mgr, child, object_info);
}
+ return;
+
+exit:
+ free(object_info->type);
+ free(object_info->group);
+ free(object_info->color_class);
+ free(object_info->part_name);
+ free(object_info->part_state);
+ free(object_info->image_name);
+ free(object_info->text);
+ free(object_info);
+ return;
}
static Eina_Bool _is_clickable_object(Evas_Object *obj)
object_info->type = calloc(1, strlen("swallow") + 1);
if (!object_info->type) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->type, "swallow", strlen("swallow") + 1);
} else if (evas_object_type_match(obj, "rectangle")) {
object_info->type = calloc(1, strlen("rect") + 1);
if (!object_info->type) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->type, "rect", strlen("rect") + 1);
evas_object_color_get(obj, &r, &g, &b, &a);
object_info->type = calloc(1, strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
if (!object_info->type) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->type, EVAS_OBJECT_TYPE_GET(obj), strlen(EVAS_OBJECT_TYPE_GET(obj)) + 1);
}
object_info->group = calloc(1, strlen(group) + 1);
if (!object_info->group) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->group, group, strlen(group) + 1);
}
object_info->color_class = calloc(1, strlen(edje_info->color_class) + 1);
if (!object_info->color_class) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->color_class, edje_info->color_class, strlen(edje_info->color_class) + 1);
}
object_info->part_state = calloc(1, strlen(ret) + 1);
if (!object_info->part_name || !object_info->part_state) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->part_name, edje_info->part_name, strlen(edje_info->part_name) + 1);
strncpy(object_info->part_state, ret, strlen(ret) + 1);
object_info->image_name = calloc(1, strlen(edje_info->image_name) + 1);
if (!object_info->image_name) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->image_name, edje_info->image_name, strlen(edje_info->image_name) + 1);
}
object_info->text = calloc(1, strlen(text) + 1);
if (!object_info->text) {
VC_ELM_LOG_ERR("[ERROR] Fail to allocate memory");
- return;
+ goto exit;
}
strncpy(object_info->text, text, strlen(text) + 1);
}
if (evas_object_type_match(obj, "elm_popup") || evas_object_type_match(obj, "elm_ctxpopup")) find_popup = 1;
}
VC_ELM_LOG_DUMP(" [%d] %s : return", cnt, EVAS_OBJECT_TYPE_GET(obj));
+
+exit:
+ free(object_info->type);
+ free(object_info->group);
+ free(object_info->color_class);
+ free(object_info->part_name);
+ free(object_info->part_state);
+ free(object_info->image_name);
+ free(object_info->text);
+ free(object_info);
}
static void