I just started to use CLANG to help find any leaks with in my code. I have a some code that CLANG shows a potential leak, but I'm not sure what I need to do to resolve it. Any help would be greatly appreciated (assuming there is something wrong with how I implemented the audio).
I'm not sure that this is truly a leak or just a warning that CLANG doesn't like. In either case, I want to clean up my code so there are no warnings or potential leaks.
Here is the code that has the potential leak (baseURL is what CLANG is complaining about):
This is called in my viewDidLoad routine to set up the sound when a button is touched.
In te dealloc routine I do dispose of the btnTouchID.
Is there a better way to define your SoundID?
Thanks.
I'm not sure that this is truly a leak or just a warning that CLANG doesn't like. In either case, I want to clean up my code so there are no warnings or potential leaks.
Here is the code that has the potential leak (baseURL is what CLANG is complaining about):
Code:
id sndpath = [[NSBundle mainBundle] pathForResource:@"Select" ofType:@"caf" inDirectory:@"/"];
CFURLRef baseURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:sndpath];
AudioServicesCreateSystemSoundID (baseURL, &btnTouchID);
This is called in my viewDidLoad routine to set up the sound when a button is touched.
In te dealloc routine I do dispose of the btnTouchID.
Is there a better way to define your SoundID?
Thanks.