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
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);