Edje: edje edit - ability to remove last item in BOX/TABLE

Removing last item in BOX/TABLE part is actually successful
but then we shouldn't realloc an array of items for 0 items.
That's ridiculous
(and because of that function removes EINA_FALSE,
so user could think that it's unable to remove last item).

So simply array can be set into NULL.

@fix
This commit is contained in:
Vitalii Vorobiov 2015-03-19 15:19:55 +02:00
parent b191379d1d
commit a21f053571
1 changed files with 10 additions and 5 deletions

View File

@ -4556,13 +4556,18 @@ edje_edit_part_item_del(Evas_Object *obj, const char *part, const char* name)
i++;
}
tmp = realloc(ep->items, sizeof(Edje_Pack_Element *) * ep->items_count);
if (!tmp)
if (ep->items_count != 0)
{
free(item);
return EINA_FALSE;
tmp = realloc(ep->items, sizeof(Edje_Pack_Element *) * ep->items_count);
if (!tmp)
{
free(item);
return EINA_FALSE;
}
ep->items = tmp;
}
ep->items = tmp;
else
ep->items = NULL;
}
GET_EED_OR_RETURN(EINA_FALSE);