[vlc-commits] qt: fix QMenu leaks
Pierre Lamot
git at videolan.org
Tue Oct 31 18:18:49 CET 2017
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Fri Oct 27 18:29:44 2017 +0200| [066551ee5b973768f07df169dfba3966d1410cf6] | committer: Jean-Baptiste Kempf
qt: fix QMenu leaks
QMenu::addMenu(QMenu*) doesn't take ownership of sub menu
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=066551ee5b973768f07df169dfba3966d1410cf6
---
modules/gui/qt/menus.cpp | 8 ++++----
modules/gui/qt/menus.hpp | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/gui/qt/menus.cpp b/modules/gui/qt/menus.cpp
index 663ac2b7e9..8bb9d56f47 100644
--- a/modules/gui/qt/menus.cpp
+++ b/modules/gui/qt/menus.cpp
@@ -609,7 +609,7 @@ QMenu *VLCMenuBar::AudioMenu( intf_thread_t *p_intf, QMenu * current )
if( current->isEmpty() )
{
addActionWithSubmenu( current, "audio-es", qtr( "Audio &Track" ) );
- audioDeviceMenu = new QMenu( qtr( "Audio &Device" ) );
+ audioDeviceMenu = new QMenu(qtr( "Audio &Device" ), current );
current->addMenu( audioDeviceMenu );
addActionWithSubmenu( current, "stereo-mode", qtr( "&Stereo Mode" ) );
current->addSeparator();
@@ -667,7 +667,7 @@ QMenu *VLCMenuBar::VideoMenu( intf_thread_t *p_intf, QMenu *current )
addActionWithSubmenu( current, "video-es", qtr( "Video &Track" ) );
current->addSeparator();
- rendererMenu = RendererMenu( p_intf );
+ rendererMenu = RendererMenu( p_intf, current );
current->addMenu( rendererMenu );
current->addSeparator();
@@ -1622,9 +1622,9 @@ void VLCMenuBar::updateRecents( intf_thread_t *p_intf )
}
}
-QMenu *VLCMenuBar::RendererMenu( intf_thread_t *p_intf )
+QMenu *VLCMenuBar::RendererMenu(intf_thread_t *p_intf, QMenu *menu )
{
- QMenu *submenu = new QMenu( qtr("&Renderer") );
+ QMenu *submenu = new QMenu( qtr("&Renderer"), menu );
rendererGroup = new QActionGroup(submenu);
diff --git a/modules/gui/qt/menus.hpp b/modules/gui/qt/menus.hpp
index 16728f54b1..99ea657986 100644
--- a/modules/gui/qt/menus.hpp
+++ b/modules/gui/qt/menus.hpp
@@ -131,7 +131,7 @@ private:
}
static QMenu *HelpMenu( QWidget * );
- static QMenu *RendererMenu( intf_thread_t *p_intf );
+ static QMenu *RendererMenu(intf_thread_t *p_intf , QMenu *menu = NULL );
/* Popups Menus */
static void PopupMenuStaticEntries( QMenu *menu );
More information about the vlc-commits
mailing list