mirror of https://github.com/axmolengine/axmol.git
Merge pull request #11223 from hawkwood/patch-6
Remove use of autorelease NSString and NSURL
This commit is contained in:
commit
6ef27df2fc
|
@ -99,8 +99,10 @@ 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) {
|
||||
printf("%s: ExtAudioFileOpenURL FAILED, Error = %ld\n", __PRETTY_FUNCTION__, (long)error);
|
||||
|
|
Loading…
Reference in New Issue