]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/extended_panels.cpp
Fix potential memleak.
[vlc] / modules / gui / qt4 / components / extended_panels.cpp
index 6cc7a34fc79d5eb0c0d3f6db87549f3290c37471..018a697f0bdd94018434d10c4cb127c06a1471c8 100644 (file)
@@ -279,7 +279,10 @@ void ExtVideo::ChangeVFiltersString( char *psz_name, bool b_add )
             psz_parser = psz_string;
             if( asprintf( &psz_string, ( *psz_string ) ? "%s:%s" : "%s%s",
                             psz_string, psz_name ) == -1 )
+            {
+                free( psz_parser );
                 return;
+            }
             free( psz_parser );
         }
         else
@@ -853,7 +856,7 @@ Equalizer::~Equalizer()
 /* Write down initial values */
 void Equalizer::updateUIFromCore()
 {
-    char *psz_af, *psz_bands;
+    char *psz_af;//, *psz_bands; Don't use it ?
     float f_preamp;
     int i_preset;
 
@@ -864,7 +867,7 @@ void Equalizer::updateUIFromCore()
         psz_af = var_GetNonEmptyString( p_aout, "audio-filter" );
         if( var_GetBool( p_aout, "equalizer-2pass" ) )
             ui.eq2PassCheck->setChecked( true );
-        psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
+//        psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
         f_preamp = var_GetFloat( p_aout, "equalizer-preamp" );
         i_preset = presetsComboBox->findData( QVariant(
                     var_GetString( p_aout, "equalizer-preset" ) ) );
@@ -875,7 +878,7 @@ void Equalizer::updateUIFromCore()
         psz_af = config_GetPsz( p_intf, "audio-filter" );
         if( config_GetInt( p_intf, "equalizer-2pass" ) )
             ui.eq2PassCheck->setChecked( true );
-        psz_bands = config_GetPsz( p_intf, "equalizer-bands" );
+//        psz_bands = config_GetPsz( p_intf, "equalizer-bands" );
         f_preamp = config_GetFloat( p_intf, "equalizer-preamp" );
         i_preset = presetsComboBox->findData( QVariant(
                     config_GetPsz( p_intf, "equalizer-preset" ) ) );
@@ -917,18 +920,6 @@ void Equalizer::enable( bool en )
     {
         bands[i]->setEnabled( en ); band_texts[i]->setEnabled( en );
     }
-
-#if 0
-    msleep( 10000 );
-
-    aout_instance_t *p_aout= ( aout_instance_t * )vlc_object_find( p_intf,
-                                 VLC_OBJECT_AOUT, FIND_ANYWHERE );
-    if( en )
-        addCallbacks( p_aout );
-    else
-        delCallbacks( p_aout );
-#endif
-
 }
 
 /* Function called when the set2Pass button is activated */
@@ -1002,6 +993,7 @@ void Equalizer::updateUISliderValues( int i_preset )
     if( i_preset < 0 ) return;
 
     char *p = createValuesFromPreset( i_preset );
+    char *psz = p;
     float f_preamp = eqz_preset_10b[i_preset]->f_preamp;
 
     if ( p )
@@ -1020,6 +1012,7 @@ void Equalizer::updateUISliderValues( int i_preset )
             if( *p == '\0' )
                 break;
         }
+        free( psz );
     }
     ui.preampSlider->setValue( (int)( ( f_preamp + 20 ) * 10 ) );
     ui.preampLabel->setText( qtr( "Preamp\n" )
@@ -1111,7 +1104,7 @@ Spatializer::Spatializer( intf_thread_t *_p_intf, QWidget *_parent ) :
     QGridLayout *layout = new QGridLayout( this );
     layout->setMargin( 0 );
 
-    enableCheck = new QCheckBox( qfu( "Enable spatializer" ) );
+    enableCheck = new QCheckBox( qtr( "Enable spatializer" ) );
     layout->addWidget( enableCheck, 0, 0, 1, NUM_SP_CTRL );
 
     for( int i = 0 ; i < NUM_SP_CTRL ; i++ )
@@ -1344,8 +1337,6 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
 
     updateButton = new QToolButton;
     updateButton->setAutoRaise( true );
-    updateButton->setText( "u" );
-    updateButton->setToolTip( qtr( "Force update of this dialog's values" ) );
     mainLayout->addWidget( updateButton, 0, 4, 1, 1 );
 
 
@@ -1360,7 +1351,8 @@ SyncControls::SyncControls( intf_thread_t *_p_intf, QWidget *_parent ) :
     CONNECT( subsSpin, valueChanged ( double ), this, advanceSubs( double ) ) ;
     CONNECT( subSpeedSpin, valueChanged ( double ),
              this, adjustSubsSpeed( double ) );
-    BUTTONACT( updateButton, update() );
+    BUTTON_SET_ACT_I( updateButton, "", update,
+            qtr( "Force update of this dialog's values" ), update() );
 
     /* Set it */
     update();