Fix fatal bug in wxXLocale initialization
Ensure that m_locale is always initialized to null pointer, as it could remain not initialized at all if information for wxLanguage could be found, but its locale name was empty, which resulted in a crash in dtor when the wxXLocale object was destroyed as freelocale() was called with an invalid pointer.
This commit is contained in:
@@ -90,12 +90,10 @@ wxXLocale& wxXLocale::GetCLocale()
|
||||
#if wxUSE_INTL
|
||||
wxXLocale::wxXLocale(wxLanguage lang)
|
||||
{
|
||||
m_locale = NULL;
|
||||
|
||||
const wxLanguageInfo * const info = wxLocale::GetLanguageInfo(lang);
|
||||
if ( !info )
|
||||
{
|
||||
m_locale = NULL;
|
||||
}
|
||||
else
|
||||
if ( info )
|
||||
{
|
||||
Init(info->GetLocaleName().c_str());
|
||||
}
|
||||
|
Reference in New Issue
Block a user