elementary/menu - fixed crash problem when non-parent item is passed to the elm_menu_seprator_item_add()

SVN revision: 70982
This commit is contained in:
ChunEon Park 2012-05-14 05:13:12 +00:00
parent 5f9bd3a8ae
commit d8f1c8014b
2 changed files with 12 additions and 2 deletions

View File

@ -34,7 +34,7 @@
2012-05-04 Leandro Pereira
* Fix icon not appearing in default Genlist theme.
* Fix icon not appearing in default Genlist theme.
2012-05-09 Cedric bail
@ -45,5 +45,11 @@
* Added focus key event handling for the colorselector
2012-05-13 Dave Andreoli
* Fileselector: honor folder_only when using EIO
2012-05-14 Shinwoo Kim
* menu: remove crash issue when no-parent item is passed to the
elm_menu_item_separator_add()

View File

@ -789,7 +789,11 @@ elm_menu_item_separator_add(Evas_Object *obj, Elm_Object_Item *parent)
/* don't add a separator as the first item */
if (!wd->items) return NULL;
/* don't allow adding more than one separator in a row */
if (p_item) subitem = eina_list_last(p_item->submenu.items)->data;
if (p_item)
{
if (!p_item->submenu.items) return NULL;
subitem = eina_list_last(p_item->submenu.items)->data;
}
else subitem = eina_list_last(wd->items)->data;
if (subitem->separator) return NULL;