mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CtrlCore: Fix macOS Ide crash when closing app from dock. (#359)
This commit is contained in:
parent
8ff90f3d3f
commit
0ac083d53d
2 changed files with 10 additions and 2 deletions
|
|
@ -45,6 +45,11 @@ NSMenu *Cocoa_DockMenu();
|
|||
Upp::Ctrl::PostReSkin();
|
||||
}
|
||||
|
||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||||
Upp::GuiLock __;
|
||||
Upp::TopWindow::ShutdownWindows();
|
||||
return NSTerminateCancel;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
|||
|
|
@ -500,12 +500,15 @@ void TopWindow::ShutdownWindows()
|
|||
again = false;
|
||||
for(int i = 0; i < tc.GetCount(); i++) {
|
||||
Ptr<TopWindow> w = dynamic_cast<TopWindow *>(tc[i]);
|
||||
if(w && w->IsOpen() && w->IsEnabled()) {
|
||||
if(w && w->IsOpen()) {
|
||||
again = true;
|
||||
w->SetForeground();
|
||||
w->ShutdownWindow();
|
||||
if(w && w->IsOpen())
|
||||
if(w && w->IsOpen()) {
|
||||
w->WhenClose();
|
||||
if(w)
|
||||
w->Close();
|
||||
}
|
||||
if(!w || !w->IsOpen())
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue