diff --git a/ipc/chromium/src/base/platform_thread_mac.mm b/ipc/chromium/src/base/platform_thread_mac.mm index 46ac2416fec2..b055b8ace175 100644 --- a/ipc/chromium/src/base/platform_thread_mac.mm +++ b/ipc/chromium/src/base/platform_thread_mac.mm @@ -7,6 +7,7 @@ #import #include "base/logging.h" +#include "base/scoped_nsautorelease_pool.h" // A simple class that demonstrates our impressive ability to do nothing. @interface NoOp : NSObject @@ -34,6 +35,10 @@ namespace base { // // http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/chapter_4_section_4.html void InitThreading() { + // this is called early in startup, before the event loop, so provide + // an autorelease pool to prevent leaks here + ScopedNSAutoreleasePool pool; + static BOOL multithreaded = [NSThread isMultiThreaded]; if (!multithreaded) { [NSThread detachNewThreadSelector:@selector(noOp)