[vlc-commits] Qt: break circular ownership at destruction

Hannes Domani git at videolan.org
Thu Jul 30 00:25:35 CEST 2015


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Tue Jul 28 18:12:25 2015 +0200| [05b300799bbcda6ab3f0aede71ce441180ab2c1d] | committer: Jean-Baptiste Kempf

Qt: break circular ownership at destruction

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/gui/qt4/components/interface_widgets.cpp |    3 ++-
 modules/gui/qt4/components/interface_widgets.hpp |    2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index 0ae578a..50cf105 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -486,7 +486,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, QWidget *parent )
     speedControl = new SpeedControlWidget( p_intf, this );
     speedControlMenu = new QMenu( this );
 
-    QWidgetAction *widgetAction = new QWidgetAction( speedControl );
+    widgetAction = new QWidgetAction( speedControl );
     widgetAction->setDefaultWidget( speedControl );
     speedControlMenu->addAction( widgetAction );
 
@@ -502,6 +502,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, QWidget *parent )
 
 SpeedLabel::~SpeedLabel()
 {
+    widgetAction->setParent( this );
     delete speedControlMenu;
 }
 
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index ce87be4..3e98522 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -47,6 +47,7 @@
 
 class QMenu;
 class QSlider;
+class QWidgetAction;
 class SpeedControlWidget;
 struct vout_window_t;
 
@@ -232,6 +233,7 @@ private:
     QMenu *speedControlMenu;
     QString tooltipStringPattern;
     SpeedControlWidget *speedControl;
+    QWidgetAction *widgetAction;
 };
 
 /******************** Speed Control Widgets ****************/



More information about the vlc-commits mailing list