[vlc-devel] commit: Fix memleaks: Fill in the destructor of simple preference. ( Rémi Duraffort )

git version control git at videolan.org
Fri Aug 1 18:38:19 CEST 2008


vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Fri Aug  1 18:40:53 2008 +0200| [07be8bb586c268720eb4deec0509f473a4d64b51] | committer: Rémi Duraffort 

Fix memleaks: Fill in the destructor of simple preference.

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

 modules/gui/qt4/components/simple_preferences.cpp |   12 ++++++++++++
 modules/gui/qt4/components/simple_preferences.hpp |    2 +-
 2 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/components/simple_preferences.cpp b/modules/gui/qt4/components/simple_preferences.cpp
index 776e0a5..4c42b43 100644
--- a/modules/gui/qt4/components/simple_preferences.cpp
+++ b/modules/gui/qt4/components/simple_preferences.cpp
@@ -568,6 +568,18 @@ void SPrefsPanel::updateAudioOptions( int number)
     optionWidgets[fileW]->setVisible( ( value == "aout_file" ) );
 }
 
+
+SPrefsPanel::~SPrefsPanel()
+{
+    QList<ConfigControl *>::Iterator conf_it;
+    for( conf_it = controls.begin() ; conf_it != controls.end() ; conf_it++ )
+    {
+        ConfigControl *c = qobject_cast<ConfigControl *>(*conf_it);
+        delete c;
+    }
+    controls.clear();
+}
+
 void SPrefsPanel::updateAudioVolume( int volume )
 {
     qobject_cast<QSpinBox *>(optionWidgets[volLW])
diff --git a/modules/gui/qt4/components/simple_preferences.hpp b/modules/gui/qt4/components/simple_preferences.hpp
index 3d18a99..afff9f4 100644
--- a/modules/gui/qt4/components/simple_preferences.hpp
+++ b/modules/gui/qt4/components/simple_preferences.hpp
@@ -105,7 +105,7 @@ class SPrefsPanel : public QWidget
     Q_OBJECT
 public:
     SPrefsPanel( intf_thread_t *, QWidget *, int );
-    virtual ~SPrefsPanel() {};
+    virtual ~SPrefsPanel();
     void apply();
     void clean();
 private:




More information about the vlc-devel mailing list