[vlc-commits] Qt: fix possible double-free on quit with simple volume widget

Jean-Baptiste Kempf git at videolan.org
Sun Jan 5 12:41:22 CET 2014


vlc/vlc-2.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Mon Dec 30 19:20:03 2013 +0100| [33512259e6641083ae54bf311f6f41efc4ba88cb] | committer: Jean-Baptiste Kempf

Qt: fix possible double-free on quit with simple volume widget

(cherry picked from commit ffd82479f6e3282bd9c8635ee775cd3a9094f176)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=33512259e6641083ae54bf311f6f41efc4ba88cb
---

 modules/gui/qt4/components/controller_widget.cpp |    8 +-------
 modules/gui/qt4/components/controller_widget.hpp |    1 -
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp
index aad30a2..66fecd9 100644
--- a/modules/gui/qt4/components/controller_widget.cpp
+++ b/modules/gui/qt4/components/controller_widget.cpp
@@ -71,7 +71,7 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
         /* Special view, click on button shows the slider */
         b_shiny = false;
 
-        volumeControlWidget = new QFrame;
+        volumeControlWidget = new QFrame( this );
         subLayout = new QVBoxLayout( volumeControlWidget );
         subLayout->setContentsMargins( 4, 4, 4, 4 );
         volumeMenu = new QMenu( this );
@@ -122,12 +122,6 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
     CONNECT( THEMIM, soundMuteChanged( bool ), this, updateMuteStatus( bool ) );
 }
 
-SoundWidget::~SoundWidget()
-{
-    delete volumeSlider;
-    delete volumeControlWidget;
-}
-
 void SoundWidget::refreshLabels()
 {
     int i_sliderVolume = volumeSlider->value();
diff --git a/modules/gui/qt4/components/controller_widget.hpp b/modules/gui/qt4/components/controller_widget.hpp
index 48a6d96..3633eaa 100644
--- a/modules/gui/qt4/components/controller_widget.hpp
+++ b/modules/gui/qt4/components/controller_widget.hpp
@@ -99,7 +99,6 @@ class SoundWidget : public QWidget
 public:
     SoundWidget( QWidget *parent, intf_thread_t  *_p_i, bool,
                  bool b_special = false );
-    virtual ~SoundWidget();
     void setMuted( bool );
 
 protected:



More information about the vlc-commits mailing list