Fork me on GitHub


[Tool] Visual C++ 記憶體洩漏偵測工具

Visual Leak Detector - Enhanced Memory Leak Detection for Visual C++


1. 下載 Visual Leak Detector
2. Copy the VLD library (*.lib) files to your Visual C++ installation's "lib" subdirectory.
3. Copy the VLD header files (vld.h and vldapi.h) to your Visual C++ installation's "include" subdirectory.
4. In the source file containing your program's main entry point, include the vld.h header file. It's best, but not absolutely required, to include this header before any other header files, except for stdafx.h. If the source file, include stdafx.h, then vld.h should be included after it.
5. If you are running Windows 2000 or earlier, then you will need to copy dbghelp.dll to the directory where the executable being debugged resides.
6. Build the debug version of your project.

完成之後,在 Debug 模式下執行程式,程式執行完畢後,Output 視窗會顯示是否偵測到 Memory Leak 的訊息,以及發生的位置。雙擊可以跳到該處。


No comments:

Post a Comment