Is AudioServicesDisposeSystemSoundID required?

余生长醉 提交于 2019-12-22 11:00:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!