mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
FIX: crash on MacOS when system logout, not really Close mainframe
Change-Id: I0e7cc73c1b4bbc663105034e82dcd7a51998e244
This commit is contained in:
parent
8319ef604c
commit
de712b08f1
3 changed files with 14 additions and 5 deletions
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue