winemac: Use a more idiomatic pattern for an autorelease pool around a loop.

Signed-off-by: Ken Thomases <ken@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Ken Thomases 2016-06-03 00:06:48 -05:00 committed by Alexandre Julliard
parent 9035e58e67
commit bdbb3514bb
1 changed files with 5 additions and 4 deletions

View File

@ -2318,11 +2318,11 @@ - (void)applicationWillResignActive:(NSNotification *)notification
*/ */
static void PerformRequest(void *info) static void PerformRequest(void *info)
{ {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
WineApplicationController* controller = [WineApplicationController sharedController]; WineApplicationController* controller = [WineApplicationController sharedController];
for (;;) for (;;)
{ {
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
__block dispatch_block_t block; __block dispatch_block_t block;
dispatch_sync(controller->requestsManipQueue, ^{ dispatch_sync(controller->requestsManipQueue, ^{
@ -2336,15 +2336,16 @@ static void PerformRequest(void *info)
}); });
if (!block) if (!block)
{
[pool release];
break; break;
}
block(); block();
[block release]; [block release];
[pool release]; [pool release];
pool = [[NSAutoreleasePool alloc] init];
} }
[pool release];
} }
/*********************************************************************** /***********************************************************************