]> git.sesse.net Git - vlc/commitdiff
skins: cosmetics about previous patch (thanks ivoire)
authorErwan Tulou <erwan10@videolan.org>
Tue, 5 Jan 2010 21:58:49 +0000 (22:58 +0100)
committerErwan Tulou <erwan10@videolan.org>
Tue, 5 Jan 2010 22:33:54 +0000 (23:33 +0100)
modules/gui/skins2/src/theme_repository.cpp

index 019ebe1b1a50429d56ef9a2ce886445f90e022e4..13ed502f06d6f10e23aac12ac3030de67335a0b7 100644 (file)
@@ -73,18 +73,16 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
         parseDirectory( *it );
     }
 
-    // retrieve skins for skins directories and locate default skins
+    // retrieve skins from skins directories and locate default skins
     map<string,string>::const_iterator itmap, itdefault;
     for( itmap = m_skinsMap.begin(); itmap != m_skinsMap.end(); itmap++ )
     {
         string path = itmap->first;
         string name = itmap->second;
-        val.psz_string = strdup( path.c_str() );
-        text.psz_string = strdup( name.c_str() );
+        val.psz_string = (char*) path.c_str();
+        text.psz_string = (char*) name.c_str();
         var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val,
                     &text );
-        free( val.psz_string );
-        free( text.psz_string );
 
         if( name == "default" )
             itdefault = itmap;
@@ -105,19 +103,16 @@ ThemeRepository::ThemeRepository( intf_thread_t *pIntf ): SkinObject( pIntf )
     itmap = m_skinsMap.find( current );
     if( itmap == m_skinsMap.end() )
     {
-        val.psz_string = strdup( current.c_str() );
-        text.psz_string = strdup( current.c_str() );
+        val.psz_string = (char*) current.c_str();
+        text.psz_string = (char*) current.c_str();
         var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val,
                     &text );
         var_Change( getIntf(), "intf-skins", VLC_VAR_SETVALUE, &val, NULL );
-        free( val.psz_string );
-        free( text.psz_string );
     }
     else
     {
-        val.psz_string = strdup( current.c_str() );
+        val.psz_string = (char*) current.c_str();
         var_Change( getIntf(), "intf-skins", VLC_VAR_SETVALUE, &val, NULL );
-        free( val.psz_string );
     }
     free( psz_current );
     m_skinsMap.clear();