[toolbar] don't leak icons into the UI

This cleans up orphan icons being left in the UI if you call icon_set
after the toolbar has been displayed.

This was most noticable if the toolbar or buttons move first

@fix
This commit is contained in:
Andy Williams 2016-01-29 15:33:27 +00:00
parent eb2085c23c
commit 7c07651d61
1 changed files with 5 additions and 0 deletions

View File

@ -2531,7 +2531,12 @@ _elm_toolbar_item_icon_obj_set(Evas_Object *obj,
eina_stringshare_del(item->icon_str);
item->icon_str = NULL;
}
if (item->icon)
{
evas_object_del(item->icon);
}
item->icon = icon_obj;
if (icon_obj)
{
ms = (icon_size * elm_config_scale_get());