From 6cb561b25ef4c00739d39f6af1902c9ef406b3a1 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 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/91729dc48a20ce9e2e004695a535d98f789731cc Author: Thilo Graf Date: 2016-05-04 (Wed, 04 May 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- 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();