[vlc-devel] [PATCH] qt: menus: fix crash with skins2

erwan.tulou at gmail.com erwan.tulou at gmail.com
Wed Dec 23 14:51:13 UTC 2020


Hi Alexandre,

  nice to hear from you ;-)

  The patch is a quick fix to skins2 crashing but also strips skins2 of 
a nice feature which is the MLRecentsModel.

  Ideally, what is needed is a complete evaluation of what the new Qt 
module has to offer and how the skins2 interface can benefit from it.

  One possible route is to merge skins2 as a full Qt application. As of 
today, there are two GUI threads : one for skins2, one for Qt as dialog, 
menu and key accelerator provider. Why not add a skins2 main interface 
(the mi pointer that causes Null dereference), compose it with the 
skins2 engine, and run it all in a single GUI thread. Then why not  
reuse all niceties that the new Qt module will offer including the new 
media library as a widget.

Rgds
Erwan


On 23/12/2020 11:36, Alexandre Janniaux wrote:
> ---
>   modules/gui/qt/menus/menus.cpp | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/modules/gui/qt/menus/menus.cpp b/modules/gui/qt/menus/menus.cpp
> index 592fbc103f..af0b0c9eb2 100644
> --- a/modules/gui/qt/menus/menus.cpp
> +++ b/modules/gui/qt/menus/menus.cpp
> @@ -221,7 +221,7 @@ QMenu *VLCMenuBar::FileMenu( intf_thread_t *p_intf, QMenu *menu, MainInterface *
>       addDPStaticEntry( menu, qtr( "Open &Location from clipboard" ),
>                         NULL, &DialogsProvider::openUrlDialog, "Ctrl+V" );
>   
> -    if( var_InheritBool( p_intf, "qt-recentplay" ) && mi->hasMediaLibrary() )
> +    if( mi && var_InheritBool( p_intf, "qt-recentplay" ) && mi->hasMediaLibrary() )
>       {
>           MLRecentsModel* recentModel = new MLRecentsModel(nullptr);
>           recentModel->setMl(mi->getMediaLibrary());
> @@ -530,7 +530,7 @@ QMenu *VLCMenuBar::NavigMenu( intf_thread_t *p_intf, QMenu *menu )
>       menu->addMenu( submenu );
>       menu->addMenu( new CheckableListMenu( qtr("&Program") , THEMIM->getPrograms(), CheckableListMenu::GROUPED , menu) );
>   
> -    if (p_intf->p_sys->p_mi->hasMediaLibrary() )
> +    if (p_intf->p_sys->p_mi && p_intf->p_sys->p_mi->hasMediaLibrary() )
>       {
>           submenu = new QMenu( qtr( I_MENU_BOOKMARK ), menu );
>           submenu->setTearOffEnabled( true );



More information about the vlc-devel mailing list