From 5fcfb868edd9af6686fe359dfd6041d581ce63ca Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Fri, 23 Apr 2021 18:07:54 +0200 Subject: sokol_app.h macos: wrap the view's draw method in an autoreleasepool, as recommended by the Metal docs --- sokol_app.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sokol_app.h b/sokol_app.h index 473c184c..8ba40fd7 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -3368,7 +3368,9 @@ _SOKOL_PRIVATE void _sapp_macos_poll_input_events() { _SOKOL_UNUSED(rect); /* Catch any last-moment input events */ _sapp_macos_poll_input_events(); - _sapp_macos_frame(); + @autoreleasepool { + _sapp_macos_frame(); + } #if !defined(SOKOL_METAL) [[_sapp.macos.view openGLContext] flushBuffer]; #endif @@ -3885,7 +3887,9 @@ _SOKOL_PRIVATE void _sapp_ios_show_keyboard(bool shown) { @implementation _sapp_ios_view - (void)drawRect:(CGRect)rect { _SOKOL_UNUSED(rect); - _sapp_ios_frame(); + @autoreleasepool { + _sapp_ios_frame(); + } } - (BOOL)isOpaque { return YES; -- cgit v1.2.3