Merge pull request #11223 from hawkwood/patch-6

Remove use of autorelease NSString and NSURL
This commit is contained in:
minggo 2015-03-31 11:57:00 +08:00
commit 6ef27df2fc
1 changed files with 4 additions and 2 deletions

View File

@ -99,7 +99,9 @@ void AudioCache::readDataTask()
AudioBufferList theDataBuffer;
ExtAudioFileRef extRef = nullptr;
auto fileURL = (CFURLRef)[[NSURL fileURLWithPath:[NSString stringWithCString:_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]]] retain];
NSString *fileFullPath = [[NSString alloc] initWithCString:_fileFullPath.c_str() encoding:[NSString defaultCStringEncoding]];
auto fileURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:fileFullPath];
[fileFullPath release];
auto error = ExtAudioFileOpenURL(fileURL, &extRef);
if(error) {