mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Fix of crash and/or assert when changing language
This commit is contained in:
@@ -860,14 +860,19 @@ void GUI_App::add_config_menu(wxMenuBar *menu)
|
||||
/* Before change application language, let's check unsaved changes on 3D-Scene
|
||||
* and draw user's attention to the application restarting after a language change
|
||||
*/
|
||||
wxMessageDialog dialog(nullptr,
|
||||
_(L("Switching the language will trigger application restart.\n"
|
||||
"You will lose content of the plater.")) + "\n\n" +
|
||||
_(L("Do you want to proceed?")),
|
||||
wxString(SLIC3R_APP_NAME) + " - " + _(L("Language selection")),
|
||||
wxICON_QUESTION | wxOK | wxCANCEL);
|
||||
if ( dialog.ShowModal() == wxID_CANCEL)
|
||||
return;
|
||||
{
|
||||
// the dialog needs to be destroyed before the call to switch_language()
|
||||
// or sometimes the application crashes into wxDialogBase() destructor
|
||||
// so we put it into an inner scope
|
||||
wxMessageDialog dialog(nullptr,
|
||||
_(L("Switching the language will trigger application restart.\n"
|
||||
"You will lose content of the plater.")) + "\n\n" +
|
||||
_(L("Do you want to proceed?")),
|
||||
wxString(SLIC3R_APP_NAME) + " - " + _(L("Language selection")),
|
||||
wxICON_QUESTION | wxOK | wxCANCEL);
|
||||
if (dialog.ShowModal() == wxID_CANCEL)
|
||||
return;
|
||||
}
|
||||
|
||||
switch_language();
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user