diff --git a/src/MainApp.h b/src/MainApp.h index 9cf584c..d707732 100644 --- a/src/MainApp.h +++ b/src/MainApp.h @@ -137,8 +137,9 @@ class MainApp : public wxApp { // wxUILocale::GetCurrent().FromTag(best); // wxTranslations::Get()->SetLanguage(best); - if (m_Locale) { - wxDELETE(m_Locale); + if (this->m_Locale != nullptr) { + delete this->m_Locale; + this->m_Locale = nullptr; } this->m_Locale = new wxLocale; this->m_Locale->Init(linfo->GetLocaleName(), newLangName); @@ -176,6 +177,6 @@ class MainApp : public wxApp { wxString backend; bool disableExternalProcessHandling = false; wxString iniPath; - wxLocale* m_Locale; + wxLocale* m_Locale = nullptr; }; #endif \ No newline at end of file