From a26be6483530bd4ee07cb7b44613055a251cce58 Mon Sep 17 00:00:00 2001 From: ashvarma Date: Tue, 17 May 2016 19:40:57 -0700 Subject: [PATCH] merge commit 9a46ace3 --- Frameworks/Foundation/NSRunLoop.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Frameworks/Foundation/NSRunLoop.mm b/Frameworks/Foundation/NSRunLoop.mm index 69512e86ae..9a091b67ef 100644 --- a/Frameworks/Foundation/NSRunLoop.mm +++ b/Frameworks/Foundation/NSRunLoop.mm @@ -526,7 +526,11 @@ - (void)removeTimer:(NSTimer*)timer forMode:(NSString*)mode { - (void)_processMainRunLoop:(int)value { NSRunLoopState* state = [self _stateForMode:NSDefaultRunLoopMode]; + // Wrap code in a autorelease pool so all the auto released objects from calling the event + // handlers can be manually released. + NSAutoreleasePool* pool = [NSAutoreleasePool new]; [state _handleSignaledInput:value]; + [pool release]; } @end