summaryrefslogtreecommitdiffstats
path: root/platform/macos/os_macos.mm
diff options
context:
space:
mode:
Diffstat (limited to 'platform/macos/os_macos.mm')
-rw-r--r--platform/macos/os_macos.mm24
1 files changed, 14 insertions, 10 deletions
diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm
index b8496d72fb..56542aff37 100644
--- a/platform/macos/os_macos.mm
+++ b/platform/macos/os_macos.mm
@@ -755,21 +755,25 @@ void OS_MacOS::run() {
return;
}
- main_loop->initialize();
+ @autoreleasepool {
+ main_loop->initialize();
+ }
bool quit = false;
while (!quit) {
- @try {
- if (DisplayServer::get_singleton()) {
- DisplayServer::get_singleton()->process_events(); // Get rid of pending events.
- }
- joypad_macos->process_joypads();
+ @autoreleasepool {
+ @try {
+ if (DisplayServer::get_singleton()) {
+ DisplayServer::get_singleton()->process_events(); // Get rid of pending events.
+ }
+ joypad_macos->process_joypads();
- if (Main::iteration()) {
- quit = true;
+ if (Main::iteration()) {
+ quit = true;
+ }
+ } @catch (NSException *exception) {
+ ERR_PRINT("NSException: " + String::utf8([exception reason].UTF8String));
}
- } @catch (NSException *exception) {
- ERR_PRINT("NSException: " + String::utf8([exception reason].UTF8String));
}
}