From 698ff2a192f644fc17b7df34c8e1c62e7327e505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Tue, 25 Mar 2025 18:41:20 +0200 Subject: [PATCH] [macOS] Fix cleanup with some command line tools. --- platform/macos/godot_application_delegate.mm | 2 +- platform/macos/os_macos.mm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platform/macos/godot_application_delegate.mm b/platform/macos/godot_application_delegate.mm index a3ee8c73c31..0421ea92e99 100644 --- a/platform/macos/godot_application_delegate.mm +++ b/platform/macos/godot_application_delegate.mm @@ -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(); diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm index 47397614846..439f43da319 100644 --- a/platform/macos/os_macos.mm +++ b/platform/macos/os_macos.mm @@ -882,9 +882,9 @@ void OS_MacOS::terminate() { void OS_MacOS::cleanup() { if (main_loop) { main_loop->finalize(); - @autoreleasepool { - Main::cleanup(); - } + } + @autoreleasepool { + Main::cleanup(); } }