Commit e5c12089 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Wrap performing requests from background threads in an autorelease pool.

Cocoa manages an autorelease pool on the main thread, but it only drains it when it processes an event. Our requests come through a run loop source, which doesn't count as an event. So, autoreleased objects can accumulate when the app is not being interacted with. Signed-off-by: 's avatarKen Thomases <ken@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 58719f60
......@@ -2295,6 +2295,7 @@ static void PerformRequest(void *info)
for (;;)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
__block dispatch_block_t block;
dispatch_sync(controller->requestsManipQueue, ^{
......@@ -2308,10 +2309,14 @@ static void PerformRequest(void *info)
});
if (!block)
{
[pool release];
break;
}
block();
[block release];
[pool release];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment