[vlc-devel] commit: qt4_extenssion: the menu need a parent (fix memory leak). ( Rémi Duraffort )

git version control git at videolan.org
Sun Jan 24 17:20:58 CET 2010


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Sun Jan 24 17:12:47 2010 +0100| [8f055856fa79bfa284f77bcd55e7556977eec769] | committer: Rémi Duraffort 

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8f055856fa79bfa284f77bcd55e7556977eec769
---

 modules/gui/qt4/menus.cpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 99c3f81..bb07f9c 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -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 *extMenu = NULL;
-
     QAction *extAction = NULL;
     foreach( QAction *action, current->actions() )
     {
@@ -515,7 +513,7 @@ QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current )
 
     ExtensionsManager *extMgr = ExtensionsManager::getInstance( p_intf );
 
-    extMenu = new QMenu( qtr( "&Extensions" ) );
+    QMenu *extMenu = new QMenu( qtr( "&Extensions" ), current );
     if( extMgr->isLoaded() )
     {
         /* Let the ExtensionsManager build itself the menu */
@@ -531,6 +529,8 @@ QMenu *QVLCMenu::ExtensionsMenu( intf_thread_t *p_intf, QMenu *current )
         extAction->setMenu( extMenu );
     else
         current->addMenu( extMenu );
+
+    return extMenu;
 }
 
 /**




More information about the vlc-devel mailing list