Commit 2f562a59 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.
parent fe922dd6
......@@ -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