You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
crazyzlj
changed the title
using Visual Leak Detector (VLD) to improve your code quality
[Protocol] Using Visual Leak Detector (VLD) to improve code quality
Mar 31, 2017
crazyzlj
changed the title
[Protocol] Using Visual Leak Detector (VLD) to improve code quality
[Protocol] Using Visual Leak Detector (VLD) to improve code quality / 利用VLD检查代码内存泄漏
Mar 31, 2017
crazyzlj
changed the title
[Protocol] Using Visual Leak Detector (VLD) to improve code quality / 利用VLD检查代码内存泄漏
Using Visual Leak Detector (VLD) to improve code quality / 利用VLD检查代码内存泄漏
Mar 31, 2017
利用Visual Leak Detector (VLD) 2.5.1 检查了模型框架代码的内存泄漏问题
代码更改详见pull7。
其实说白了内存泄漏就是没有把new和delete配对使用,但是实际编码中,尤其是涉及复杂类与类之间相互调用的时候,理清什么时候释放哪块内存是不太容易的。
我这次主要检查了数组、含有自定义数据类型(或类实例)的容器(vector,map等)以及复杂类的释放及析构函数,这些可能涵盖了我们日常编程常见的内存泄漏问题。
对于复杂类的编写,大家要遵循“Rules of three”原则,即如果你的类需要以下任意一个函数,那么就请显式写出所有三个:
点这里扩展阅读。
The text was updated successfully, but these errors were encountered: