OpenAL 导致我的 iPhone 游戏出现泄漏

发布于 2024-08-26 23:27:22 字数 727 浏览 3 评论 0原文

我正在从 this 中找到的代码将 OpenAL 集成到我的 iPhone 游戏中发布,但编译器在这行代码上给了我一个错误:
unsigned char *outData = malloc(fileSize);

所以我将其更改为:
unsigned char *outData = (unsigned char*) malloc(fileSize);

这消除了编译器错误,但似乎引发了两个泄漏:
Malloc 32 字节 0x505cb40 AudioToolbox SimAggregateDevice::CreateAggregateDevice(__CFString const*, __CFString const*, unsigned long&)


NSCFDictionary 0x505be30 64 AudioToolbox SimAggregateDevice::CreateAggregateDevice(__CFString const*, __CFString const*, unsigned long&)

这是由于我更改了 unsigned char 行吗?如果有人能帮助我消除这些泄漏,我将不胜感激。

I am integrating OpenAL in my iPhone game from code I found in this post, but the compiler gave me an error on this line of code:
unsigned char *outData = malloc(fileSize);

so I changed it to this:
unsigned char *outData = (unsigned char*) malloc(fileSize);.

This got rid of the compiler errors, but seems to have thrown up two leaks:
Malloc 32 Bytes 0x505cb40 AudioToolbox SimAggregateDevice::CreateAggregateDevice(__CFString const*, __CFString const*, unsigned long&)

and
NSCFDictionary 0x505be30 64 AudioToolbox SimAggregateDevice::CreateAggregateDevice(__CFString const*, __CFString const*, unsigned long&)

Is this due to me changing the unsigned char line? I would be very grateful if someone could help me to remove these leaks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夏见 2024-09-02 23:27:22

我假设您使用的是 .mm 文件而不是 .m (这是我认为编译器在没有强制转换的情况下会产生错误的唯一原因)。您所做的更改不会对内存管理产生任何影响,并且肯定不会导致泄漏。使用后是否释放这些数据?

I'm assuming you are using a .mm file instead of a .m (It's the only reason I can think that the compiler will yield an error without the cast). The change you made will have no effect on memory management, and will certainly not cause the leak. Are you freeing this data after using it?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文