From d78d6b34e997bbdc9726b55791b6f7b729b68ab4 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 23 Mar 2019 11:33:50 +0100 Subject: [PATCH] fix segfault with static item, supplement to 69ae7d89e3f179a4263abbadc6cc7951607a3854 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9a638ac41679f319b8b88a6cf256e5f269b5032f Author: Jacek Jendrzej Date: 2019-03-23 (Sat, 23 Mar 2019) --- src/gui/widget/menue.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index f25abc195..a6f51efda 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -778,8 +778,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;