coco2dx heap corruption detected by dlfree 闪退的问题
来源:互联网 发布:java servlet 编辑:程序博客网 时间:2024/05/21 21:36
如果你也遇到 了这个问题,请一定要检查你的代码有没有访问越界
今天打包游戏到手机上发现有时候进游戏会闪退,有时候不会闪退。看到log上有这样的错误:heap corruption detected by dlfree
于是网上查了一下,其它人说这是因为内存溢出的问题,后来发现是在我自己读文件 的时候出了问题具体如下:
ssize_t bufferSize = 0;
string fullPath = CCFileUtils::sharedFileUtils()->fullPathForFilename(fileName);
pBuffer = FileUtils::sharedFileUtils()->getFileData(fullPath, "rb" , &bufferSize);
一开始我以为bufferSize的大小应该是文件内容大小+1(其实不是)。
我为了让json更好地读,于是在后面加了个0:
pBuffer[bufferSize] = 0;
就是这一句造成了闪退,如果大家有这样的闪退问题不妨查查看是否有这样的内存操作语句。
0 0
- coco2dx heap corruption detected by dlfree 闪退的问题
- 安卓开发报错 heap corruption detected by dlfree
- CString引发的Heap corruption detected
- heap corruption detected可能的原因
- Heap Corruption Detected 错误的原因分析
- Heap corruption detected error
- Heap Corruption detected
- heap corruption detected
- Heap Corruption Detected
- C++ Heap corruption detected
- HEAP CORRUPTION DETECTED
- C++ Heap corruption detected
- heap corruption detected
- Heap Corruption Detected解决方法
- Heap corruption detected error
- HEAP CORRUPTION DETECTED
- Heap Corruption Detected Error
- Heap corruption detected.
- VC 仿QQ窗口靠边自动收缩隐藏效果
- poj3694
- 大数模板(加减乘除取模开方)
- IOS推送功能的实现
- 你应该知道的一些事情——CSS权重
- coco2dx heap corruption detected by dlfree 闪退的问题
- java.util.ConcurrentModificationException 解决办法
- 大话设计模式之初见(一)
- 【经验】对教务处网站的抓包分析并GET教务处照片
- wdcp 或者 主机宝 或 阿里云一键安装包 再也不用担心 服务器环境搭建了
- 关于cocos2dx观察者模式(CCNotificationCenter)
- Java生产消费者模式之项目实践
- urllib
- VS2013 Qt5显示中文字符