Store item pointer before removal.

This commit is contained in:
Jari Vetoniemi 2014-10-25 21:54:03 +03:00
parent c1bdca9cc4
commit ba03036a39

View File

@ -288,10 +288,10 @@ bm_menu_remove_item_at(struct bm_menu *menu, uint32_t index)
if (!menu->items.items || menu->items.count <= index)
return 0;
struct bm_item *item = ((struct bm_item**)menu->items.items)[index];
bool ret = list_remove_item_at(&menu->items, index);
if (ret) {
struct bm_item *item = ((struct bm_item**)menu->items.items)[index];
list_remove_item(&menu->selection, item);
list_remove_item(&menu->filtered, item);
}