diff options
| author | Andre Weissflog <floooh@gmail.com> | 2021-04-23 17:58:11 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2021-04-23 17:58:11 +0200 |
| commit | dd7b4685207663c17025f32c3a462de72e896dea (patch) | |
| tree | ffc0077aeae87b9b1e6ebdd7d0b0488935e164f0 | |
| parent | 236be4bd1e9493ff97688000492e54c6eac06f6a (diff) | |
sokol_app.h metal: autoreleasepool in view's drawRect method
| -rw-r--r-- | sokol_app.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sokol_app.h b/sokol_app.h index c2b67e24..f6ef0f6b 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -3852,10 +3852,12 @@ _SOKOL_PRIVATE void _sapp_macos_frame(_sapp_window_t* win) { - (void)drawRect:(NSRect)rect { _SOKOL_UNUSED(rect); _sapp_window_t* win = _sapp_push_window(self.win_id); - _sapp_macos_frame(win); - #if !defined(SOKOL_METAL) - [[_sapp.macos.view openGLContext] flushBuffer]; - #endif + @autoreleasepool { + _sapp_macos_frame(win); + #if !defined(SOKOL_METAL) + [[_sapp.macos.view openGLContext] flushBuffer]; + #endif + } _sapp_pop_window(); } @@ -4394,7 +4396,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; |