[vlc-devel] commit: skins2: simplification. ( Rémi Duraffort )
git version control
git at videolan.org
Thu Feb 26 18:06:48 CET 2009
vlc | branch: master | Rémi Duraffort <ivoire at videolan.org> | Thu Feb 26 11:23:32 2009 +0100| [410e1456ded4f5be5a8633a3e013289ef3402e89] | committer: Rémi Duraffort
skins2: simplification.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=410e1456ded4f5be5a8633a3e013289ef3402e89
---
modules/gui/skins2/src/theme_repository.cpp | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/modules/gui/skins2/src/theme_repository.cpp b/modules/gui/skins2/src/theme_repository.cpp
index 3db8a42..8aef4e6 100644
--- a/modules/gui/skins2/src/theme_repository.cpp
+++ b/modules/gui/skins2/src/theme_repository.cpp
@@ -131,14 +131,12 @@ void ThemeRepository::parseDirectory( const string &rDir_locale )
// Add the theme in the popup menu
string shortname = name.substr( 0, name.size() - 4 );
- val.psz_string = new char[path.size() + 1];
- text.psz_string = new char[shortname.size() + 1];
- strcpy( val.psz_string, path.c_str() );
- strcpy( text.psz_string, shortname.c_str() );
+ val.psz_string = strdup( path.c_str() );
+ text.psz_string = strdup( shortname.c_str() );
var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val,
&text );
- delete[] val.psz_string;
- delete[] text.psz_string;
+ free( val.psz_string );
+ free( text.psz_string );
}
free( pszDirContent );
More information about the vlc-devel
mailing list