OpenAL 导致我的 iPhone 游戏出现泄漏
我正在从 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&)
andNSCFDictionary 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您使用的是 .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?