| Index: webrtc/test/mac/run_test.mm
|
| diff --git a/webrtc/test/mac/run_test.mm b/webrtc/test/mac/run_test.mm
|
| index d6df69c46a8cf91c3bad40fe00f9a9205435215f..4e0093a9b6e40f6c13b52ede10e0bdd0cc100bd7 100644
|
| --- a/webrtc/test/mac/run_test.mm
|
| +++ b/webrtc/test/mac/run_test.mm
|
| @@ -36,10 +36,10 @@
|
| }
|
|
|
| - (void)runAllTests:(TestBlock)testBlock {
|
| - @autoreleasepool {
|
| - testBlock();
|
| - running_ = NO;
|
| - }
|
| + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
| + testBlock();
|
| + running_ = NO;
|
| + [pool release];
|
| }
|
|
|
| - (BOOL)running {
|
| @@ -51,23 +51,24 @@
|
| namespace test {
|
|
|
| void RunTest(void(*test)()) {
|
| - @autoreleasepool {
|
| - [NSApplication sharedApplication];
|
| + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
| + [NSApplication sharedApplication];
|
|
|
| - // Convert the function pointer to an Objective-C block and call on a
|
| - // separate thread, to avoid blocking the main thread.
|
| - TestRunner *testRunner = [[TestRunner alloc] init];
|
| - TestBlock testBlock = functionToBlock(test);
|
| - [NSThread detachNewThreadSelector:@selector(runAllTests:)
|
| - toTarget:testRunner
|
| - withObject:testBlock];
|
| + // Convert the function pointer to an Objective-C block and call on a
|
| + // separate thread, to avoid blocking the main thread.
|
| + TestRunner *testRunner = [[TestRunner alloc] init];
|
| + TestBlock testBlock = functionToBlock(test);
|
| + [NSThread detachNewThreadSelector:@selector(runAllTests:)
|
| + toTarget:testRunner
|
| + withObject:testBlock];
|
|
|
| - NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
|
| - while ([testRunner running] &&
|
| - [runLoop runMode:NSDefaultRunLoopMode
|
| - beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]);
|
| - }
|
| + NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
|
| + while ([testRunner running] &&
|
| + [runLoop runMode:NSDefaultRunLoopMode
|
| + beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]);
|
|
|
| + [testRunner release];
|
| + [pool release];
|
| }
|
|
|
| } // namespace test
|
|
|