Permalink
Browse files

Released fileURL after creation in Recorder.m. Thanks August Joki.

  • Loading branch information...
1 parent f5ed5ec commit f349a494e2be70ebcf8ed6f89e6dc90a04a356cd Erica Sadun committed Sep 23, 2009
Showing with 2 additions and 1 deletion.
  1. +2 −1 C15-Media/06-AudioQueue Recording/Recorder.m
@@ -74,10 +74,11 @@ - (BOOL) startRecording: (NSString *) filePath
// new input queue
OSStatus status;
status = AudioQueueNewInput(&recordState.dataFormat, HandleInputBuffer, &recordState, CFRunLoopGetCurrent(),kCFRunLoopCommonModes, 0, &recordState.queue);
- if (status) {printf("Could not establish new queue\n"); return NO;}
+ if (status) {CFRelease(fileURL); printf("Could not establish new queue\n"); return NO;}
// create new audio file
status = AudioFileCreateWithURL(fileURL, kAudioFileAIFFType, &recordState.dataFormat, kAudioFileFlags_EraseFile, &recordState.audioFile);
+ CFRelease(fileURL); // thanks august joki
if (status) {printf("Could not create file to record audio\n"); return NO;}
// figure out the buffer size

0 comments on commit f349a49

Please sign in to comment.