【Visual Leak Detector】QT 中 VLD 输出解析(一)

说明

使用 VLD 内存泄漏检测工具辅助开发时整理的学习笔记。本人博客园同步更新

1. 使用方式

在 QT 中使用 VLD 的方法可以查看另外几篇博客:

本次测试使用的环境为:QT 5.9.2MSVC 2015 32bitDebug 模式,VLD 版本为 2.5.1,VLD 配置文件不做任何更改使用默认配置,测试工程所在路径为:E:\Cworkspace\Qt 5.9\QtDemo\testVLD

2. 无内存泄漏时的输出报告

写一个简单的无内存泄漏的程序,如下:

#include <QCoreApplication>
#include "vld.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    return a.exec();
}

程序运行结束后,并没有检测到内存泄漏,VLD 会输出以下 4 行报告:

Visual Leak Detector read settings from: D:\Program Files (x86)\Visual Leak Detector\vld.ini
Visual Leak Detector Version 2.5.1 installed.
No memory leaks detected.
Visual Leak Detector is now exiting.

第 1 行表示 VLD 读取的配置文件路径,可以根据路径找到该文件,然后更改里面的相关配置,获得想要的效果。

第 2 行表示 VLD 2.5.1 在程序中初始化成功。

第 3 行表示本次运行没有检测到内存泄漏。

第 4 行表示 VLD 正常退出。

猜你喜欢

转载自blog.csdn.net/m0_37803477/article/details/129771910