Changeset ab429b30404726cac5cc7fc18bb1be222177e12b

Show
Ignore:
Timestamp:
04/09/05 23:50:18 (3 years ago)
Author:
Olivier Teulière <ipkiss@videolan.org>
git-committer:
Olivier Teulière <ipkiss@videolan.org> 1125870618 +0000
git-parent:

[3a0a0ec7cb538a264f86f72732ee491c5ca9b657]

git-author:
Olivier Teulière <ipkiss@videolan.org> 1125870618 +0000
Message:
  • skins2/src/theme_repository.cpp: do not use pointers on temporary strings.
    Fixes #337.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/skins2/src/theme_repository.cpp

    rab6a48f rab429b3  
    127127 
    128128            // Add the theme in the popup menu 
    129             val.psz_string = (char*)path.c_str(); 
    130             text.psz_string = (char*)name.substr(0, name.size() - 4).c_str(); 
     129            string shortname = name.substr( 0, name.size() - 4 ); 
     130            val.psz_string = new char[path.size() + 1]; 
     131            text.psz_string = new char[shortname.size() + 1]; 
     132            strcpy( val.psz_string, path.c_str() ); 
     133            strcpy( text.psz_string, shortname.c_str() ); 
    131134            var_Change( getIntf(), "intf-skins", VLC_VAR_ADDCHOICE, &val, 
    132135                        &text ); 
     136            delete[] val.psz_string; 
     137            delete[] text.psz_string; 
    133138        } 
    134139