toolbar: Fix crash on more_item when shrink mode is set with no item.

Toolbar creates a more_item when shrink mode is
ELM_TOOLBAR_SHRINK_EXPAND.
If select mode is ELM_OBJECT_SELECT_MODE_ALWAYS and there is no item
appended, then toolbar sets a selection on a newly created item.
In this case, sd->more_item is referenced before the new more_item is
assigned to sd->more_item.

@fix
This commit is contained in:
Jaehyun Cho 2015-10-12 16:46:36 +09:00
parent 72cebeb662
commit 5d85d6a29f
1 changed files with 2 additions and 0 deletions

View File

@ -1077,6 +1077,8 @@ _item_select(Elm_Toolbar_Item_Data *it)
if (eo_do_ret(EO_OBJ(it), tmp, elm_wdg_item_disabled_get()) || (it->separator) || (it->object))
return;
if ((sd->shrink_mode == ELM_TOOLBAR_SHRINK_EXPAND) && (!sd->more_item))
return;
sel = it->selected;
if ((sd->select_mode != ELM_OBJECT_SELECT_MODE_NONE) &&