Merge pull request #11224 from hawkwood/patch-7

Remove use of autorelease NSString and NSURL
This commit is contained in:
minggo 2015-04-09 18:36:07 +08:00
commit 09c50c44dc
1 changed files with 3 additions and 1 deletions

View File

@ -116,7 +116,9 @@ void AudioPlayer::rotateBufferThread(int offsetFrame)
ALint bufferProcessed = 0;
ExtAudioFileRef extRef = nullptr;
auto fileURL = (CFURLRef)[[NSURL fileURLWithPath:[NSString stringWithCString:_audioCache->_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]]] retain];
NSString *fileFullPath = [[NSString alloc] initWithCString:_audioCache->_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]];
auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath];
[fileFullPath release];
char* tmpBuffer = (char*)malloc(_audioCache->_queBufferBytes);
auto frames = _audioCache->_queBufferFrames;