问题
I recently started working with the AudioToolbox framework and noticed that there is a method called AudioServicesDisposeSystemSoundID()
.
Just to know, is it a memory leak not to call the above method when calling AudioServicesCreateSystemSoundID()
to init my SystemSoundID
? I am calling it like:
AudioServicesCreateSystemSoundID((CFURLRef)filePath, &sound);
That way filePath being a NSURL and sound SystemSoundID
.
回答1:
Yes. Call it when you're done with sound
. Otherwise, you may leak any memory associated with sound
(which can be significant for A/V files.)
来源:https://stackoverflow.com/questions/7728057/is-audioservicesdisposesystemsoundid-required