diff options
| author | Andre Weissflog <floooh@gmail.com> | 2021-04-23 18:07:54 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2021-04-23 18:07:54 +0200 |
| commit | 5fcfb868edd9af6686fe359dfd6041d581ce63ca (patch) | |
| tree | f821328fa62ad222acba05195405289ba20c4464 | |
| parent | c7506acdf621978fcc9f122863144452df4bece2 (diff) | |
sokol_app.h macos: wrap the view's draw method in an autoreleasepool, as recommended by the Metal docs
| -rw-r--r-- | sokol_app.h | 8 |
1 files 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; |