是否需要AudioServicesDisposeSystemSoundID? [英] Is AudioServicesDisposeSystemSoundID required?
问题描述
我最近开始使用AudioToolbox框架,并注意到有一个名为AudioServicesDisposeSystemSoundID()
的方法.
I recently started working with the AudioToolbox framework and noticed that there is a method called AudioServicesDisposeSystemSoundID()
.
只知道,调用AudioServicesCreateSystemSoundID()
初始化我的SystemSoundID
时不调用上述方法是否会导致内存泄漏?我这样称呼它:
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);
那样,filePath是一个NSURL和声音SystemSoundID
.
That way filePath being a NSURL and sound SystemSoundID
.
推荐答案
是. sound
完成后调用它.否则,您可能会泄漏与sound
相关联的所有内存(这对A/V文件可能很重要).
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.)
这篇关于是否需要AudioServicesDisposeSystemSoundID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!