[macOS] Fix cleanup with some command line tools.

This commit is contained in:
Pāvels Nadtočajevs
2025-03-25 18:41:20 +02:00
parent 1ba856565d
commit 698ff2a192
2 changed files with 4 additions and 4 deletions

View File

@ -240,7 +240,7 @@
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
if (ds) {
if (ds && ds->has_window(DisplayServerMacOS::MAIN_WINDOW_ID)) {
ds->send_window_event(ds->get_window(DisplayServerMacOS::MAIN_WINDOW_ID), DisplayServerMacOS::WINDOW_EVENT_CLOSE_REQUEST);
}
OS_MacOS *os = (OS_MacOS *)OS::get_singleton();

View File

@ -882,9 +882,9 @@ void OS_MacOS::terminate() {
void OS_MacOS::cleanup() {
if (main_loop) {
main_loop->finalize();
@autoreleasepool {
Main::cleanup();
}
}
@autoreleasepool {
Main::cleanup();
}
}