[vlc-commits] qt: toolbar: Do not parent new QWidgetListItem before insertion

Hugo Beauzée-Luyssen git at videolan.org
Mon Sep 4 12:03:39 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Sep  2 15:46:57 2017 +0200| [8e75eb34faa8c32b812b1fe526da3d7440f91f46] | committer: Hugo Beauzée-Luyssen

qt: toolbar: Do not parent new QWidgetListItem before insertion

This prevent undefined behavior upon insertion.
Fix #18751

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8e75eb34faa8c32b812b1fe526da3d7440f91f46
---

 modules/gui/qt/dialogs/toolbar.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/gui/qt/dialogs/toolbar.cpp b/modules/gui/qt/dialogs/toolbar.cpp
index bc6b547e4e..9e8da6d20f 100644
--- a/modules/gui/qt/dialogs/toolbar.cpp
+++ b/modules/gui/qt/dialogs/toolbar.cpp
@@ -440,7 +440,7 @@ WidgetListing::WidgetListing( intf_thread_t *p_intf, QWidget *_parent )
     for( int i = SPLITTER; i < SPECIAL_MAX; i++ )
     {
         QWidget *widget = NULL;
-        QListWidgetItem *widgetItem = new QListWidgetItem( this );
+        QListWidgetItem *widgetItem = new QListWidgetItem;
         widgetItem->setSizeHint( QSize( widgetItem->sizeHint().width(), 32 ) );
         switch( i )
         {



More information about the vlc-commits mailing list