]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/simple_preferences.cpp
Preferences: fix some memleaks and fix horrible video-filter bug. :D
[vlc] / modules / gui / qt4 / components / simple_preferences.cpp
index 4c42b43240a3e0b14ced5cff6c451fddcae4b42a..980b504b6de62c2d52ccc35be5d69f6c773101d0 100644 (file)
@@ -40,6 +40,8 @@
 #include <QUrl>
 #include <QVBoxLayout>
 
+#include <QtAlgorithms>
+
 #include <string>
 
 #define ICON_HEIGHT 64
@@ -571,13 +573,7 @@ void SPrefsPanel::updateAudioOptions( int number)
 
 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();
+    qDeleteAll( controls ); controls.clear();
 }
 
 void SPrefsPanel::updateAudioVolume( int volume )