no unpost_menu when item_count is 0

master
denes 7 years ago
parent ad5e9aa91d
commit 578c0341da
Signed by: denes
GPG Key ID: A7D50EAD42F9FC9F

@ -139,6 +139,7 @@ void GraphBrowser::cleanUp()
ITEM** old_items = menu_items(menu_); ITEM** old_items = menu_items(menu_);
const int old_items_count = item_count(menu_); const int old_items_count = item_count(menu_);
if (old_items_count > 0)
assert(unpost_menu(menu_) == E_OK); assert(unpost_menu(menu_) == E_OK);
assert(free_menu(menu_) == E_OK); assert(free_menu(menu_) == E_OK);
for (int i = 0; i < old_items_count; ++i) for (int i = 0; i < old_items_count; ++i)
@ -307,8 +308,10 @@ void GraphBrowser::addItems(const std::vector<std::string>& stringVector, bool f
ITEM** old_items = menu_items(menu_); ITEM** old_items = menu_items(menu_);
const int old_items_count = item_count(menu_); const int old_items_count = item_count(menu_);
if (old_items_count > 0) {
const int u = unpost_menu(menu_); const int u = unpost_menu(menu_);
assert (u == E_OK || first_run && u == E_NOT_POSTED); assert (u == E_OK || first_run && u == E_NOT_POSTED);
}
const int number_of_new_items = stringVector.size(); const int number_of_new_items = stringVector.size();
ITEM** new_items = 0; ITEM** new_items = 0;

Loading…
Cancel
Save