是否需要AudioServicesDisposeSystemSoundID? [英] Is AudioServicesDisposeSystemSoundID required?

查看:96
本文介绍了是否需要AudioServicesDisposeSystemSoundID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始使用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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆