Skip to content

Commit 594d64e

Browse files
committed
Merge pull request #104615 from bruvzg/cleanup_fix
[macOS] Fix cleanup with some command line tools.
2 parents b699508 + 698ff2a commit 594d64e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

platform/macos/godot_application_delegate.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ - (void)applicationWillTerminate:(NSNotification *)notification {
240240

241241
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
242242
DisplayServerMacOS *ds = (DisplayServerMacOS *)DisplayServer::get_singleton();
243-
if (ds) {
243+
if (ds && ds->has_window(DisplayServerMacOS::MAIN_WINDOW_ID)) {
244244
ds->send_window_event(ds->get_window(DisplayServerMacOS::MAIN_WINDOW_ID), DisplayServerMacOS::WINDOW_EVENT_CLOSE_REQUEST);
245245
}
246246
OS_MacOS *os = (OS_MacOS *)OS::get_singleton();

platform/macos/os_macos.mm

+3-3
Original file line numberDiff line numberDiff line change
@@ -882,9 +882,9 @@
882882
void OS_MacOS::cleanup() {
883883
if (main_loop) {
884884
main_loop->finalize();
885-
@autoreleasepool {
886-
Main::cleanup();
887-
}
885+
}
886+
@autoreleasepool {
887+
Main::cleanup();
888888
}
889889
}
890890

0 commit comments

Comments
 (0)