[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 26/26] ui/cocoa.m: Remove unnecessary NSAutoreleasePools
From: |
Peter Maydell |
Subject: |
[PULL 26/26] ui/cocoa.m: Remove unnecessary NSAutoreleasePools |
Date: |
Wed, 2 Mar 2022 20:52:30 +0000 |
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>
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Tested-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-id: 20220224101330.967429-3-peter.maydell@linaro.org
---
ui/cocoa.m | 6 ------
1 file changed, 6 deletions(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 5ed1495552a..b6e70e9134d 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)
--
2.25.1
- [PULL 18/26] target/arm: Extend arm_fi_to_lfsc to level -1, (continued)
- [PULL 18/26] target/arm: Extend arm_fi_to_lfsc to level -1, Peter Maydell, 2022/03/02
- [PULL 22/26] target/arm: Advertise all page sizes for -cpu max, Peter Maydell, 2022/03/02
- [PULL 23/26] target/arm: Implement FEAT_LPA2, Peter Maydell, 2022/03/02
- [PULL 25/26] ui/cocoa.m: Fix updateUIInfo threading issues, Peter Maydell, 2022/03/02
- [PULL 16/26] target/arm: Implement FEAT_LVA, Peter Maydell, 2022/03/02
- [PULL 19/26] target/arm: Introduce tlbi_aa64_get_range, Peter Maydell, 2022/03/02
- [PULL 24/26] target/arm: Report KVM's actual PSCI version to guest in dtb, Peter Maydell, 2022/03/02
- [PULL 13/26] target/arm: Use MAKE_64BIT_MASK to compute indexmask, Peter Maydell, 2022/03/02
- [PULL 20/26] target/arm: Fix TLBIRange.base for 16k and 64k pages, Peter Maydell, 2022/03/02
- [PULL 21/26] target/arm: Validate tlbi TG matches translation granule in use, Peter Maydell, 2022/03/02
- [PULL 26/26] ui/cocoa.m: Remove unnecessary NSAutoreleasePools,
Peter Maydell <=
- Re: [PULL 00/26] target-arm queue, Peter Maydell, 2022/03/03