[PATCH 1/3] winemac: Use a more idiomatic pattern for an autorelease pool around a loop.
Ken Thomases
ken at codeweavers.com
Fri Jun 3 00:06:48 CDT 2016
Signed-off-by: Ken Thomases <ken at codeweavers.com>
---
dlls/winemac.drv/cocoa_app.m | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index f64de31..dced704 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -2318,11 +2318,11 @@ - (void)applicationWillResignActive:(NSNotification *)notification
*/
static void PerformRequest(void *info)
{
+ NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
WineApplicationController* controller = [WineApplicationController sharedController];
for (;;)
{
- NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
__block dispatch_block_t block;
dispatch_sync(controller->requestsManipQueue, ^{
@@ -2336,15 +2336,16 @@ static void PerformRequest(void *info)
});
if (!block)
- {
- [pool release];
break;
- }
block();
[block release];
+
[pool release];
+ pool = [[NSAutoreleasePool alloc] init];
}
+
+ [pool release];
}
/***********************************************************************
--
2.8.2
More information about the wine-patches
mailing list