[vlc-devel] [PATCH 1/4] Qt: break circular ownership at destruction

Hannes Domani ssbssa at yahoo.de
Tue Jul 28 18:12:25 CEST 2015


---
 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 ****************/
-- 
2.4.6




More information about the vlc-devel mailing list