Fix continual allocation of auto-releaseable NSDate objects

The startInterval method of the AudioPlayer module causes a
continually increasing number of NSDate objects to be
allocated. The auto-release pool which wraps this code doesn't
drain frequently enough causing an application's memory
footprint to grow by roughly a megabyte every 5 minutes.
This commit is contained in:
Piers 2013-04-17 09:37:57 +00:00
parent cf36e20e3e
commit 4e019bfcf2
1 changed files with 2 additions and 1 deletions

View File

@ -1632,7 +1632,8 @@ static void AudioQueueIsRunningCallbackProc(void* userData, AudioQueueRef audioQ
break;
}
[playbackThreadRunLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:10]];
NSDate *date = [[NSDate alloc] initWithTimeIntervalSinceNow:10];
[playbackThreadRunLoop runMode:NSDefaultRunLoopMode beforeDate:date];
}
disposeWasRequested = NO;