widget/menue fix memleak, CMenuWidget::removeItem

Origin commit data
------------------
Commit: 34ac796ffa
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2019-03-20 (Wed, 20 Mar 2019)
This commit is contained in:
Jacek Jendrzej
2019-03-20 12:41:48 +01:00
committed by vanhofen
parent 33d3fe0381
commit 7d5654876e

View File

@@ -778,6 +778,8 @@ 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;
items.erase(items.begin()+item_id);
if ((unsigned int) selected >= items.size())
selected = items.size() - 1;