diff options
authorPeter Maydell <peter.maydell@linaro.org>2022-02-08 17:39:40 +0000
committerPeter Maydell <peter.maydell@linaro.org>2022-02-22 17:29:20 +0000
commit68516b73ccc2fa8cecb51b932f6962dc1a814810 (patch)
parent84ae8c15569f3b7f6d240ea993e74457895a7870 (diff)
ui/cocoa.m: Remove unnecessary NSAutoreleasePoolscocoa-pools
In commit 6e657e64cdc478 in 2013 we added some autorelease pools to deal with complaints from macOS when we made calls into Cocoa from threads that didn't have automatically created autorelease pools. Later on, macOS got stricter about forbidding cross-thread Cocoa calls, and in commit 5588840ff77800e839d8 we restructured the code to avoid them. This left the autorelease pool creation in several functions without any purpose; delete it. We still need the pool in cocoa_refresh() for the clipboard related code which is called directly there. Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
1 files changed, 0 insertions, 6 deletions
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 5ed1495552..b6e70e9134 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1976,8 +1976,6 @@ int main (int argc, char **argv) {
static void cocoa_update(DisplayChangeListener *dcl,
int x, int y, int w, int h)
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
COCOA_DEBUG("qemu_cocoa: cocoa_update\n");
dispatch_async(dispatch_get_main_queue(), ^{
@@ -1993,14 +1991,11 @@ static void cocoa_update(DisplayChangeListener *dcl,
[cocoaView setNeedsDisplayInRect:rect];
- [pool release];
static void cocoa_switch(DisplayChangeListener *dcl,
DisplaySurface *surface)
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
pixman_image_t *image = surface->image;
COCOA_DEBUG("qemu_cocoa: cocoa_switch\n");
@@ -2015,7 +2010,6 @@ static void cocoa_switch(DisplayChangeListener *dcl,
[cocoaView updateUIInfo];
[cocoaView switchSurface:image];
- [pool release];
static void cocoa_refresh(DisplayChangeListener *dcl)