From bdbb3514bb08e1deed99e39b1fe29fec5a366b29 Mon Sep 17 00:00:00 2001 From: Ken Thomases Date: Fri, 3 Jun 2016 00:06:48 -0500 Subject: [PATCH] winemac: Use a more idiomatic pattern for an autorelease pool around a loop. Signed-off-by: Ken Thomases Signed-off-by: Alexandre Julliard --- 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 f64de31632a..dced704af99 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]; } /***********************************************************************