Symbian 使用 fopen() 内存泄漏的解决方法
来源:互联网 发布:js用户名密码验证 编辑:程序博客网 时间:2024/06/06 08:59
最近在把TinyXML移植到Symbian平台,可是一直存在内存泄漏,经过检查,内存泄漏原因在TiXmlDocument::LoadFile()中,
如上代码所示,加上CloseSTDLIB()后,内存泄漏消失,不调用CloseSTDLIB会出现内存泄露。
必须调用CloseSTDLIB的原因是:
Because the data allocated in the thread-local storage for STDLIB's DLL (the _reent structure) is not automatically cleaned up when the environment is destroyed, it must be cleaned up by the user of STDLIB.
The function to achieve this is CloseSTDLIB(). To use this function, file epoc32/include/libc/sys/reent.h should be included in the project. Call CloseSTDLIB() after the point at which it is known that code in STDLIB's DLL will no longer be called and its thread-local storage no longer needed.
参考:http://discussion.forum.nokia.com/forum/showthread.php?t=165359
- Symbian 使用 fopen() 内存泄漏的解决方法
- 使用cvLoadImage导致内存泄漏的解决方法
- symbian使用HookLogger检测内存泄漏
- Symbian OS内存泄漏
- VC内存泄漏的解决方法
- ACE与MFC一起使用时内存泄漏的解决方法
- symbian S60 使用HookLogger查找内存泄漏错误
- 内存泄漏以及常见的解决方法
- 内存泄漏以及常见的解决方法
- 内存泄漏以及常见的解决方法
- 内存泄漏以及常见的解决方法
- 多线程中CString内存泄漏的解决方法。
- 内存泄漏以及常见的解决方法
- 内存泄漏以及常见的解决方法
- 内存泄漏以及常见的解决方法
- 内存泄漏以及常见的解决方法
- 内存泄漏以及常见的解决方法
- 内存泄漏以及常见的解决方法
- 系统分析师论文评分标准
- C#实现XML系列化和反系列化的总结
- table表格布局
- Android的Log图文详解(Log.v,Log.d,Log.i,Log.w,Log.e)!
- JSON学习
- Symbian 使用 fopen() 内存泄漏的解决方法
- thinkpad system update cleaner
- ASP.NET 首页性能的十大做法
- for in的缺陷
- DOS批处理技巧一.符号应用(转)
- 处理某分组列值有重复时,只显示分组的首行列值
- weblogic9中deploy web项目时报classnotfoundexception
- 基于Arcscene的3D建模
- 爽