]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/simple_preferences.cpp
Less memleaks in Qt interface.
[vlc] / modules / gui / qt4 / components / simple_preferences.cpp
index 2f62769b096d68042fbe9bc6fae8b0b1d3aa1350..28ac5fa33519ddb17b510b5ed83a8b1a8c7fded6 100644 (file)
@@ -101,6 +101,7 @@ void SPrefsCatList::switchPanel( int i )
 SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                           int _number ) : QWidget( _parent ), p_intf( _p_intf )
 {
+printf( "SPrefsPanel::SPrefsPanel\n" );
     module_config_t *p_config;
     ConfigControl *control;
     number = _number;
@@ -334,7 +335,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
 
             CONNECT( ui.volNormBox, toggled( bool ), ui.volNormSpin,
                      setEnabled( bool ) );
-            qs_filter = qfu( config_GetPsz( p_intf, "audio-filter" ) );
+            char* psz = config_GetPsz( p_intf, "audio-filter" );
+            qs_filter = qfu( psz );
+            free( psz );
             bool b_normalizer = ( qs_filter.contains( "volnorm" ) );
             {
                 ui.volNormBox->setChecked( b_normalizer );
@@ -365,8 +368,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                 {
                     ui.DVDDevice->setText( qfu( psz_dvddiscpath ) );
                 }
-                delete psz_cddadiscpath; delete psz_dvddiscpath;
-                delete psz_vcddiscpath;
+                free( psz_cddadiscpath );
+                free( psz_dvddiscpath );
+                free( psz_vcddiscpath );
             }
 
             CONFIG_GENERIC_NO_BOOL( "server-port", Integer, NULL, UDPPort );
@@ -380,7 +384,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
             ui.systemCodecBox->hide();
 #endif
             /* Access Filters */
-            qs_filter = qfu( config_GetPsz( p_intf, "access-filter" ) );
+            char* psz = config_GetPsz( p_intf, "access-filter" );
+            qs_filter = qfu( psz );
+            free( psz );
             ui.timeshiftBox->setChecked( qs_filter.contains( "timeshift" ) );
             ui.dumpBox->setChecked( qs_filter.contains( "dump" ) );
             ui.recordBox->setChecked( qs_filter.contains( "record" ) );
@@ -470,7 +476,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                 else if( strstr( psz_intf, "qt" ) )
                     ui.qt4->setChecked( true );
             }
-            delete psz_intf;
+            free( psz_intf );
 
             optionWidgets.append( ui.skins );
             optionWidgets.append( ui.qt4 );