Prevent string conversion buffer to stay in memory

This commit is contained in:
Tsuda Kageyu 2013-06-11 12:51:26 +09:00
parent 804f882e38
commit c9904354f9

View File

@ -49,15 +49,15 @@ namespace
inline char *stringToCharArray(const String &s)
{
const char *c = s.toCString(unicodeStrings);
const std::string str = s.to8Bit(unicodeStrings);
#ifdef HAVE_ISO_STRDUP
return ::_strdup(c);
return ::_strdup(str.c_str());
#else
return ::strdup(c);
return ::strdup(str.c_str());
#endif
}