Commit dc807170 authored by jpd's avatar jpd
Browse files

Qt: delete submenus when clearing the View menu

Prevent unnecessary memory accumulation when new submenus are
created again and again.
parent 4f0759ef
......@@ -430,7 +430,16 @@ QMenu *QVLCMenu::ViewMenu( intf_thread_t *p_intf, QMenu *current, MainInterface
menu = current;
//HACK menu->clear() does not delete submenus
QList<QAction*> actions = menu->actions();
foreach( QAction *a, actions )
QMenu *m = a->menu();
if( m && m->parent() == menu ) delete m;
if( a->parent() == menu ) delete a;
else menu->removeAction( a );
MainInterface *mi = _mi ? _mi : p_intf->p_sys->p_mi;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment