Commit e9dd62ed authored by Erwan Tulou's avatar Erwan Tulou

qt: fix recentsMenu that causes skins2 to crash

Skins2 uses FileMenu in the PopupMenu (short lifetime). This causes the
static variable recentsMenu to be freed and then be dereferenced.

The patch creates a one-off recentsMenu, that is used by the different
instances of FileMenu via the addMenu function (no transfer of ownership).

It follows the same pattern as the other two static audioDeviceMenu
and rendererMenu. Note that these static variables are never freed.

(cherry picked from commit 2f562a59)
Signed-off-by: 's avatarErwan Tulou <>
parent f6a176c3
......@@ -370,9 +370,11 @@ QMenu *VLCMenuBar::FileMenu( intf_thread_t *p_intf, QWidget *parent, MainInterfa
addDPStaticEntry( menu, qtr( "Open &Location from clipboard" ),
NULL, SLOT( openUrlDialog() ), "Ctrl+V" );
if( var_InheritBool( p_intf, "qt-recentplay" ) )
if( !recentsMenu && var_InheritBool( p_intf, "qt-recentplay" ) )
recentsMenu = new QMenu( qtr( "Open &Recent Media" ) );
if( recentsMenu )
recentsMenu = new QMenu( qtr( "Open &Recent Media" ), menu );
updateRecents( p_intf );
menu->addMenu( recentsMenu );
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