1
0
mirror of https://github.com/thes3m/XNI synced 2024-12-26 13:26:06 +01:00

Fixed garbage creation in AudioContent.

git-svn-id: http://xni.googlecode.com/svn/XNI@121 ac433895-eea3-a490-d80a-17149a75e588
This commit is contained in:
Matej Jan 2012-10-12 18:24:05 +00:00
parent 08abf7ffe0
commit 63ea4cf7e3
2 changed files with 8 additions and 7 deletions

View File

@ -21,7 +21,6 @@
int loopStart;
@private
NSURL *fileUrl;
ExtAudioFileRef extRef;
}

View File

@ -16,7 +16,7 @@
{
self = [super init];
if (self != nil) {
fileName = theFileName;
fileName = [theFileName retain];
fileType = theFileType;
// Load file.
@ -25,10 +25,12 @@
UInt32 thePropertySize = sizeof(theFileFormat);
// Open a file with ExtAudioFileOpen().
fileUrl = [[NSURL fileURLWithPath:theFileName] retain];
extRef = nil;
NSURL *fileUrl = [NSURL fileURLWithPath:theFileName];
extRef = nil;
err = ExtAudioFileOpenURL((CFURLRef)fileUrl, &extRef);
if (err) {
if (err) {
[NSException raise:@"NotSupportedException" format:@"ExtAudioFileOpenURL FAILED, Error = %ld\n", err];
}
@ -111,9 +113,9 @@
- (void) dealloc
{
//if (extRef) ExtAudioFileDispose(extRef);
if (extRef) ExtAudioFileDispose(extRef);
[format release];
[fileUrl release];
[fileName release];
[super dealloc];
}