mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
FIX: crash on MacOS when system logout, not really Close mainframe
Change-Id: I0e7cc73c1b4bbc663105034e82dcd7a51998e244
This commit is contained in:
@@ -1836,7 +1836,16 @@ bool GUI_App::on_init_inner()
|
||||
CBaseException::set_log_folder(data_dir());
|
||||
#endif
|
||||
|
||||
wxGetApp().Bind(wxEVT_QUERY_END_SESSION, [](auto & e) {
|
||||
wxGetApp().Bind(wxEVT_QUERY_END_SESSION, [this](auto & e) {
|
||||
if (mainframe) {
|
||||
wxCloseEvent e2(wxEVT_CLOSE_WINDOW);
|
||||
e2.SetCanVeto(true);
|
||||
mainframe->GetEventHandler()->ProcessEvent(e2);
|
||||
if (e2.GetVeto()) {
|
||||
e.Veto();
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (auto d : dialogStack)
|
||||
d->EndModal(1);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user