From 91729dc48a20ce9e2e004695a535d98f789731cc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 4 May 2016 17:42:51 +0200 Subject: [PATCH] CMenuWidget: avoid dangling pointer after delete --- src/gui/widget/menue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 64baaca59..4935cf5bf 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -677,8 +677,10 @@ void CMenuWidget::resetWidget(bool delete_items) { for(unsigned int count=0;countisStatic) + if (delete_items && !item->isStatic){ delete item; + item = NULL; + } } items.clear();