Skip to content

Commit

Permalink
fix segfault with static item, supplement to 69ae7d8
Browse files Browse the repository at this point in the history
  • Loading branch information
satbaby committed Mar 23, 2019
1 parent 819f6af commit 54885c0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/widget/menue.cpp
Expand Up @@ -780,8 +780,10 @@ void CMenuWidget::insertItem(const uint& item_id, CMenuItem* menuItem)

void CMenuWidget::removeItem(const uint& item_id)
{
delete items.at(item_id);
items.at(item_id) = NULL;
if(!items.at(item_id)->isStatic){
delete items.at(item_id);
items.at(item_id) = NULL;
}
items.erase(items.begin()+item_id);
if ((unsigned int) selected >= items.size())
selected = items.size() - 1;
Expand Down

0 comments on commit 54885c0

Please sign in to comment.