Skip to content

Commit

Permalink
fix nullptr in mainapp
Browse files Browse the repository at this point in the history
  • Loading branch information
fszontagh committed Nov 14, 2024
1 parent c4ef022 commit 338b60a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/MainApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -176,6 +177,6 @@ class MainApp : public wxApp {
wxString backend;
bool disableExternalProcessHandling = false;
wxString iniPath;
wxLocale* m_Locale;
wxLocale* m_Locale = nullptr;
};
#endif

0 comments on commit 338b60a

Please sign in to comment.