[vlc-devel] [Re:] [vlc-commits] commit: Qt: delete unneeded MenuItemData (Jakob Leben )

brezhoneg1 brezhoneg1 at yahoo.fr
Fri Apr 2 22:52:43 CEST 2010


Hi,

>Qt: delete unneeded MenuItemData (Jakob Leben
eacddb63e8a5bda42395ee79b5b27db6408] | committer: Jakob Leben 
>
>Qt: delete unneeded MenuItemData
>
>>
http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=193e6eacddb63e8a5
bda42395ee79b5b27db6408
>---
>
> modules/gui/qt4/menus.cpp |    5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
>diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
>index 51e982f..b0f4264 100644
>--- a/modules/gui/qt4/menus.cpp
>+++ b/modules/gui/qt4/menus.cpp
>@@ -1456,8 +1456,9 @@ void QVLCMenu::CreateAndConnect( QMenu *menu,
const char *psz_var,
> 
>     action->setChecked( checked );
> 
>-    MenuItemData *itemData = new MenuItemData( THEDP->menusMapper,
p_obj, i_val_type,
>-            val, psz_var );
>+    MenuItemData *itemData = qFindChild<MenuItemData*>( action,
QString() );
>+    delete itemData;
>+    itemData = new MenuItemData( action, p_obj, i_val_type, val,
psz_var );
> 
>     /* remove previous signal-slot connection(s) if any */
>     action->disconnect( );


This patch was singled out as the one causing a regression for skins2 (a
user of qt4 menus),
 namely skins2 yet again crashing at exit on both win32 and Linux.

When using qFindChild, are we sure there is a unique direct child for an
action ?
Technically, there could be multiple ones, in which case the one being
deleted 
is may still be addressed elsewhere.  (qt4 doc seems to say it is
undefined in this case)

As a matter of fact, just reverting this patch does solve the problem.

Was this patch correcting a specific issue or just intended as a
cosmetic ?

Regards
Erwan10




More information about the vlc-devel mailing list