Use just "char *" for wxMBConv_iconv::m_name to avoid MT-safety problems
related to using a wxString (which is not always MT-safe) from multiple
threads.
See #12630.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65968
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
virtual wxMBConv *Clone() const
{
virtual wxMBConv *Clone() const
{
- wxMBConv_iconv *p = new wxMBConv_iconv(m_name.ToAscii());
+ wxMBConv_iconv *p = new wxMBConv_iconv(m_name);
p->m_minMBCharWidth = m_minMBCharWidth;
return p;
}
p->m_minMBCharWidth = m_minMBCharWidth;
return p;
}
// name of the encoding handled by this conversion
// name of the encoding handled by this conversion
// cached result of GetMBNulLen(); set to 0 meaning "unknown"
// initially
// cached result of GetMBNulLen(); set to 0 meaning "unknown"
// initially
bool wxMBConv_iconv::ms_wcNeedsSwap = false;
wxMBConv_iconv::wxMBConv_iconv(const char *name)
bool wxMBConv_iconv::ms_wcNeedsSwap = false;
wxMBConv_iconv::wxMBConv_iconv(const char *name)
+ : m_name(wxStrdup(name))
wxMBConv_iconv::~wxMBConv_iconv()
{
wxMBConv_iconv::~wxMBConv_iconv()
{
+ free(const_cast<char *>(m_name));
+
if ( m2w != ICONV_T_INVALID )
iconv_close(m2w);
if ( w2m != ICONV_T_INVALID )
if ( m2w != ICONV_T_INVALID )
iconv_close(m2w);
if ( w2m != ICONV_T_INVALID )