mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-30 08:51:10 +02:00
CMenuWidget: avoid dangling pointer after delete
This commit is contained in:
@@ -677,8 +677,10 @@ void CMenuWidget::resetWidget(bool delete_items)
|
||||
{
|
||||
for(unsigned int count=0;count<items.size();count++) {
|
||||
CMenuItem * item = items[count];
|
||||
if (delete_items && !item->isStatic)
|
||||
if (delete_items && !item->isStatic){
|
||||
delete item;
|
||||
item = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
items.clear();
|
||||
|
Reference in New Issue
Block a user