Commit 8f055856 authored by Rémi Duraffort's avatar Rémi Duraffort

qt4_extenssion: the menu need a parent (fix memory leak).

parent c2282767
...@@ -501,8 +501,6 @@ QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -501,8 +501,6 @@ QMenu *QVLCMenu::InterfacesMenu( intf_thread_t *p_intf, QMenu *current )
**/ **/
QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current ) QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current )
{ {
QMenu *extMenu = NULL;
QAction *extAction = NULL; QAction *extAction = NULL;
foreach( QAction *action, current->actions() ) foreach( QAction *action, current->actions() )
{ {
...@@ -515,7 +513,7 @@ QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -515,7 +513,7 @@ QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current )
ExtensionsManager *extMgr = ExtensionsManager::getInstance( p_intf ); ExtensionsManager *extMgr = ExtensionsManager::getInstance( p_intf );
extMenu = new QMenu( qtr( "&Extensions" ) ); QMenu *extMenu = new QMenu( qtr( "&Extensions" ), current );
if( extMgr->isLoaded() ) if( extMgr->isLoaded() )
{ {
/* Let the ExtensionsManager build itself the menu */ /* Let the ExtensionsManager build itself the menu */
...@@ -531,6 +529,8 @@ QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current ) ...@@ -531,6 +529,8 @@ QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current )
extAction->setMenu( extMenu ); extAction->setMenu( extMenu );
else else
current->addMenu( extMenu ); current->addMenu( extMenu );
return extMenu;
} }
/** /**
......
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