diff --git a/CHANGES.txt b/CHANGES.txt
index c180ae60..0c60c90c 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -3,6 +3,16 @@ Visual Leak Detector (VLD) Version 2.5.7
Change Log / Release Notes
+2.5.9 (28 March 2022)
+----------------------------
+ Enhancements:
+ + New option to beep if leaks found (mrphiltx)
+ + Installer puts VLD directories in VC Directories option in the .props (mrphiltx)
+ + Support for Visual Studio 2022 (avadae/grrava)
+
+ Bugs Fixed:
+ + Reverted change in utility.cpp that prevented leaks from being reported in x86 builds (avadae/grrava)
+
2.5.8 (1 December 2021)
----------------------------
Bugs Fixed:
diff --git a/lib/cppformat/format.vcxproj b/lib/cppformat/format.vcxproj
index 1291123c..429eba85 100644
--- a/lib/cppformat/format.vcxproj
+++ b/lib/cppformat/format.vcxproj
@@ -23,14 +23,14 @@
Win32Proj
Win32
libformat
- 10.0.19041.0
+ 10.0
libformat
StaticLibrary
MultiByte
- v142
+ v143
diff --git a/setup/build_version.bat b/setup/build_version.bat
index 3768daa6..7930a32e 100644
--- a/setup/build_version.bat
+++ b/setup/build_version.bat
@@ -5,7 +5,7 @@ TITLE Building VLD...
SETLOCAL ENABLEDELAYEDEXPANSION
REM Check if the needed files are present
-IF "%VS160COMNTOOLS%"=="" GOTO :BadPaths
+IF "%VS170COMNTOOLS%"=="" GOTO :BadPaths
CD %~dp0/..
diff --git a/setup/version.h b/setup/version.h
index 5a938969..60b43210 100644
--- a/setup/version.h
+++ b/setup/version.h
@@ -1,9 +1,9 @@
-#define VLDVERSION L"2.5.8"
-#define VERSION_NUMBER 2,5,8,0
-#define VERSION_STRING "2.5.8.0"
-#define VERSION_COPYRIGHT "Copyright (C) 2005-2021"
+#define VLDVERSION L"2.5.9"
+#define VERSION_NUMBER 2,5,9,0
+#define VERSION_STRING "2.5.9.0"
+#define VERSION_COPYRIGHT "Copyright (C) 2005-2022"
#ifndef __FILE__
-!define VLD_VERSION "2.5.8" // NSIS Script
+!define VLD_VERSION "2.5.9" // NSIS Script
#endif
diff --git a/setup/vld-setup.iss b/setup/vld-setup.iss
index 6e3b2d85..86956636 100644
--- a/setup/vld-setup.iss
+++ b/setup/vld-setup.iss
@@ -2,12 +2,12 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Visual Leak Detector"
-#define MyAppVersion "2.5.8"
+#define MyAppVersion "2.5.9"
#define MyAppPublisher "VLD Team"
#define MyAppURL "http://vld.codeplex.com/"
#define MyAppRegKey "Software\Visual Leak Detector"
#define ConfigType "Release"
-#define PlatformVersion "v142"
+#define PlatformVersion "v143"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
@@ -65,7 +65,7 @@ Source: "Microsoft.Cpp.x64.user.props"; DestDir: "{localappdata}\Microsoft\MSBui
[Tasks]
Name: "modifypath"; Description: "Add VLD directory to your environmental path"
Name: "modifyVS2008Props"; Description: "Add VLD directory to VS 2008"
-Name: "modifyVS2010Props"; Description: "Add VLD directory to VS 2010 - VS 2015"
+Name: "modifyVS2010Props"; Description: "Add VLD directory to VS 2010 - VS 2022"
[ThirdParty]
UseRelativePaths=True
@@ -311,11 +311,30 @@ begin
Log(dirList);
end;
-procedure ModifyProps(filename: string; libfolder: string);
+function OpenOrCreate(XMLDocument: Variant; baseNode : Variant; nodeId: string) : Variant;
+var
+ nodePath: string;
+ XMLNodes: Variant;
+ XMLNode: Variant; // temp for creation
+begin
+ UpdateString(nodePath, '//b:', nodeId);
+ XMLNodes := baseNode.SelectNodes(nodePath);
+ if XMLNodes.Length > 0 then
+ Result := XMLNodes.Item[0]
+ else
+ begin
+ XMLNode := XMLDocument.CreateNode(1, nodeId, 'http://schemas.microsoft.com/developer/msbuild/2003');
+ Result := baseNode.AppendChild(XMLNode);
+ end;
+end;
+
+procedure ModifyProps(filename: string; libfolder: string; arch: string);
var
XMLDocument: Variant;
XMLParent, IdgNode, XMLNode, XMLNodes: Variant;
+ ProjNode, PropNode, IpNode, LpNode: Variant; // use the VC Directories options
IncludeDirectoriesNode: Variant;
+ propAttr: string;
AdditionalIncludeDirectories: string;
DynamicLibraryDirectoriesNode: Variant;
AdditionalDynamicLibraryDirectories: string;
@@ -332,91 +351,86 @@ begin
begin
XMLDocument.setProperty('SelectionLanguage', 'XPath');
XMLDocument.setProperty('SelectionNamespaces', 'xmlns:b=''http://schemas.microsoft.com/developer/msbuild/2003''');
- XMLNodes := XMLDocument.SelectNodes('//b:Project');
- if XMLNodes.Length = 0 then
+ ProjNode := XMLDocument.SelectNodes('//b:Project');
+ // if project node doesn't exist, then bail
+ if ProjNode.Length = 0 then
Exit;
- IdgNode := XMLNodes.Item[0];
- XMLNodes := IdgNode.SelectNodes('//b:ItemDefinitionGroup');
- if XMLNodes.Length > 0 then
- IdgNode := XMLNodes.Item[0]
- else
- begin
- XMLNode := XMLDocument.CreateNode(1, 'ItemDefinitionGroup',
- 'http://schemas.microsoft.com/developer/msbuild/2003');
- IdgNode := IdgNode.AppendChild(XMLNode);
- end;
- XMLNodes := IdgNode.SelectNodes('//b:ClCompile');
- if XMLNodes.Length > 0 then
- XMLParent := XMLNodes.Item[0]
- else
- begin
- XMLNode := XMLDocument.CreateNode(1, 'ClCompile',
- 'http://schemas.microsoft.com/developer/msbuild/2003');
- XMLParent := IdgNode.AppendChild(XMLNode);
- end;
- XMLNodes := XMLParent.SelectNodes('//b:ClCompile/b:AdditionalIncludeDirectories');
- if XMLNodes.Length > 0 then
- IncludeDirectoriesNode := XMLNodes.Item[0]
- else
- begin
- XMLNode := XMLDocument.CreateNode(1, 'AdditionalIncludeDirectories',
- 'http://schemas.microsoft.com/developer/msbuild/2003');
- IncludeDirectoriesNode := XMLParent.AppendChild(XMLNode);
- end;
+ // ItemDefinitionGroup
+ IdgNode := OpenOrCreate(XMLDocument, projNode.Item[0], 'ItemDefinitionGroup');
- XMLNodes := IdgNode.SelectNodes('//b:Link');
- if XMLNodes.Length > 0 then
- XMLParent := XMLNodes.Item[0]
- else
+ // PropertyGroup - might have the label on it, so look for one without a label, and create if needed
+ XMLParent := ProjNode.Item[0].SelectNodes('//b:PropertyGroup');
+ if XMLParent.Length > 0 then
begin
- XMLNode := XMLDocument.CreateNode(1, 'Link',
- 'http://schemas.microsoft.com/developer/msbuild/2003');
- XMLParent := IdgNode.AppendChild(XMLNode);
- end;
- XMLNodes := XMLParent.SelectNodes('//b:Link/b:AdditionalLibraryDirectories');
- if XMLNodes.Length > 0 then
- DynamicLibraryDirectoriesNode := XMLNodes.Item[0]
- else
+ PropNode := XMLParent.Item[0];
+ propAttr := PropNode.GetAttribute('Label');
+ if not VarIsNull(propAttr) then
+ begin
+ if XMLParent.Length > 1 then
+ begin
+ PropNode := XMLParent.Item[1];
+ end
+ end
+ end
+ if VarIsNull(PropNode) then
begin
- XMLNode := XMLDocument.CreateNode(1, 'AdditionalLibraryDirectories',
- 'http://schemas.microsoft.com/developer/msbuild/2003');
- DynamicLibraryDirectoriesNode := XMLParent.AppendChild(XMLNode);
- end;
-
- XMLNodes := IdgNode.SelectNodes('//b:Lib');
- if XMLNodes.Length > 0 then
- XMLParent := XMLNodes.Item[0]
- else
- begin
- XMLNode := XMLDocument.CreateNode(1, 'Lib',
- 'http://schemas.microsoft.com/developer/msbuild/2003');
- XMLParent := IdgNode.AppendChild(XMLNode);
- end;
+ XMLNode := XMLDocument.CreateNode(1, 'PropertyGroup','http://schemas.microsoft.com/developer/msbuild/2003');
+ PropNode := ProjNode.AppendChild(XMLNode);
+ end
+
+ // IncludePath
+ IpNode := OpenOrCreate(XMLDocument, PropNode, 'IncludePath');
+ // LibraryPath
+ LpNode := OpenOrCreate(XMLDocument, PropNode, 'LibraryPath');
+
+// // ClCompile -> puts the directory in the compiler section of the properties
+// XMLParent := OpenOrCreate(XMLDocument, IdgNode, 'ClCompile');
+// XMLNodes := XMLParent.SelectNodes('//b:ClCompile/b:AdditionalIncludeDirectories');
+// if XMLNodes.Length > 0 then
+// IncludeDirectoriesNode := XMLNodes.Item[0]
+// else
+// begin
+// XMLNode := XMLDocument.CreateNode(1, 'AdditionalIncludeDirectories', 'http://schemas.microsoft.com/developer/msbuild/2003');
+// IncludeDirectoriesNode := XMLParent.AppendChild(XMLNode);
+// end;
+
+// // Link -> puts the directory in the linker section of the properties
+// XMLParent := OpenOrCreate(XMLDocument, IdgNode, 'Link');
+// XMLNodes := XMLParent.SelectNodes('//b:Link/b:AdditionalLibraryDirectories');
+// if XMLNodes.Length > 0 then
+// DynamicLibraryDirectoriesNode := XMLNodes.Item[0]
+// else
+// begin
+// XMLNode := XMLDocument.CreateNode(1, 'AdditionalLibraryDirectories', 'http://schemas.microsoft.com/developer/msbuild/2003');
+// DynamicLibraryDirectoriesNode := XMLParent.AppendChild(XMLNode);
+// end;
+
+ // Lib (static lib)
+ XMLParent := OpenOrCreate(XMLDocument, IdgNode, 'Lib');
XMLNodes := XMLParent.SelectNodes('//b:Lib/b:AdditionalLibraryDirectories');
if XMLNodes.Length > 0 then
StaticLibraryDirectoriesNode := XMLNodes.Item[0]
else
begin
- XMLNode := XMLDocument.CreateNode(1, 'AdditionalLibraryDirectories',
- 'http://schemas.microsoft.com/developer/msbuild/2003');
+ XMLNode := XMLDocument.CreateNode(1, 'AdditionalLibraryDirectories', 'http://schemas.microsoft.com/developer/msbuild/2003');
StaticLibraryDirectoriesNode := XMLParent.AppendChild(XMLNode);
end;
AdditionalIncludeDirectories := '';
- if not VarIsNull(IncludeDirectoriesNode) then
- AdditionalIncludeDirectories := IncludeDirectoriesNode.Text;
+ if not VarIsNull(IpNode) then
+ AdditionalIncludeDirectories := IpNode.Text;
AdditionalDynamicLibraryDirectories := '';;
- if not VarIsNull(DynamicLibraryDirectoriesNode) then
- AdditionalDynamicLibraryDirectories := DynamicLibraryDirectoriesNode.Text;
+ if not VarIsNull(LpNode) then
+ AdditionalDynamicLibraryDirectories := LpNode.Text;
AdditionalStaticLibraryDirectories := '';;
if not VarIsNull(StaticLibraryDirectoriesNode) then
AdditionalStaticLibraryDirectories := StaticLibraryDirectoriesNode.Text;
- UpdateString(AdditionalIncludeDirectories, ExpandConstant('{app}\include;'), '%(AdditionalIncludeDirectories)');
- UpdateString(AdditionalDynamicLibraryDirectories, ExpandConstant('{app}\lib\' + libfolder + ';'), '%(AdditionalLibraryDirectories)');
- UpdateString(AdditionalStaticLibraryDirectories, ExpandConstant('{app}\lib\' + libfolder + ';'), '%(AdditionalLibraryDirectories)');
- IncludeDirectoriesNode.Text := AdditionalIncludeDirectories;
- DynamicLibraryDirectoriesNode.Text := AdditionalDynamicLibraryDirectories;
+ UpdateString(AdditionalIncludeDirectories, ExpandConstant('{app}\include;'), '$(IncludePath)');
+ UpdateString(AdditionalDynamicLibraryDirectories, ExpandConstant('{app}\lib\' + libfolder + ';'), '$(LibraryPath)');
+ UpdateString(AdditionalStaticLibraryDirectories, ExpandConstant('{app}\lib\' + libfolder + ';'), '$(AdditionalLibraryDirectories)');
+ IpNode.Text := AdditionalIncludeDirectories;
+ LpNode.Text := AdditionalDynamicLibraryDirectories;
StaticLibraryDirectoriesNode.Text := AdditionalStaticLibraryDirectories;
XMLDocument.save(filename);
end;
@@ -432,8 +446,8 @@ begin
Path := GetEnv('LOCALAPPDATA')+'\Microsoft\MSBuild\v4.0\';
if DirExists(Path) then
begin
- ModifyProps(Path + 'Microsoft.Cpp.Win32.user.props', 'Win32');
- ModifyProps(Path + 'Microsoft.Cpp.x64.user.props', 'Win64');
+ ModifyProps(Path + 'Microsoft.Cpp.Win32.user.props', 'Win32', 'x86');
+ ModifyProps(Path + 'Microsoft.Cpp.x64.user.props', 'Win64', 'x64');
end;
end;
diff --git a/src/tests/basics/basics.vcxproj b/src/tests/basics/basics.vcxproj
index 1e04a41e..0bccd047 100644
--- a/src/tests/basics/basics.vcxproj
+++ b/src/tests/basics/basics.vcxproj
@@ -55,13 +55,13 @@
Win32Proj
test_basics
test_basics
- 10.0.19041.0
+ 10.0
Application
Unicode
- v142
+ v143
true
@@ -342,4 +342,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/corruption/corruption.vcxproj b/src/tests/corruption/corruption.vcxproj
index 81eeba79..e99fa327 100644
--- a/src/tests/corruption/corruption.vcxproj
+++ b/src/tests/corruption/corruption.vcxproj
@@ -54,14 +54,14 @@
{87911ED6-84BC-4526-9654-A4FF4E0EDF52}
Win32Proj
corruption
- 10.0.19041.0
+ 10.0
corruption
Application
Unicode
- v142
+ v143
true
@@ -315,4 +315,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/dynamic_app/dynamic_app.vcxproj b/src/tests/dynamic_app/dynamic_app.vcxproj
index 3c08bbb7..304dca06 100644
--- a/src/tests/dynamic_app/dynamic_app.vcxproj
+++ b/src/tests/dynamic_app/dynamic_app.vcxproj
@@ -54,14 +54,14 @@
{5C25E1C8-00CB-4E0A-9BEC-952F0A6E5DCA}
Win32Proj
dynamic_app
- 10.0.19041.0
+ 10.0
dynamic_app
Application
Unicode
- v142
+ v143
true
@@ -325,4 +325,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/dynamic_dll/dynamic.vcxproj b/src/tests/dynamic_dll/dynamic.vcxproj
index feb20a8c..88def073 100644
--- a/src/tests/dynamic_dll/dynamic.vcxproj
+++ b/src/tests/dynamic_dll/dynamic.vcxproj
@@ -55,13 +55,13 @@
Win32Proj
dynamic
dynamic
- 10.0.19041.0
+ 10.0
DynamicLibrary
Unicode
- v142
+ v143
true
@@ -335,4 +335,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/mfc/vldmfc.vcxproj b/src/tests/mfc/vldmfc.vcxproj
index 9d3a9e30..8d3cfaf2 100644
--- a/src/tests/mfc/vldmfc.vcxproj
+++ b/src/tests/mfc/vldmfc.vcxproj
@@ -37,7 +37,7 @@
{A231973E-072A-428E-982E-5363ADD1CDE2}
MFCProj
- 10.0.19041.0
+ 10.0
vldmfc
vldmfc
@@ -45,7 +45,7 @@
Application
Unicode
- v142
+ v143
Dynamic
@@ -290,4 +290,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/mfc_dll/mfc.vcxproj b/src/tests/mfc_dll/mfc.vcxproj
index 352f3a68..22ecefa5 100644
--- a/src/tests/mfc_dll/mfc.vcxproj
+++ b/src/tests/mfc_dll/mfc.vcxproj
@@ -55,13 +55,13 @@
test_mfc
MFCDLLProj
test_mfc
- 10.0.19041.0
+ 10.0
DynamicLibrary
Unicode
- v142
+ v143
true
@@ -405,4 +405,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/static_string_test/static_string_test.vcxproj b/src/tests/static_string_test/static_string_test.vcxproj
index ac658864..a4e5e84d 100644
--- a/src/tests/static_string_test/static_string_test.vcxproj
+++ b/src/tests/static_string_test/static_string_test.vcxproj
@@ -55,13 +55,13 @@
Win32Proj
static_string_test
static_string_test
- 10.0.19041.0
+ 10.0
Application
Unicode
- v142
+ v143
true
diff --git a/src/tests/suite/testsuite.vcxproj b/src/tests/suite/testsuite.vcxproj
index d878ab25..eeb60864 100644
--- a/src/tests/suite/testsuite.vcxproj
+++ b/src/tests/suite/testsuite.vcxproj
@@ -53,14 +53,14 @@
{EE4A829C-5FD8-460B-8A90-B518B9BABB70}
testsuite
- 10.0.19041.0
+ 10.0
testsuite
Application
NotSet
- v142
+ v143
@@ -294,4 +294,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/vld_ComTest/ComTest_vs14.vcxproj b/src/tests/vld_ComTest/ComTest_vs14.vcxproj
index 74beac4a..bd03d6e7 100644
--- a/src/tests/vld_ComTest/ComTest_vs14.vcxproj
+++ b/src/tests/vld_ComTest/ComTest_vs14.vcxproj
@@ -55,13 +55,13 @@
AtlProj
ComTest
ComTest
- 10.0.19041.0
+ 10.0
DynamicLibrary
Unicode
- v142
+ v143
true
@@ -563,4 +563,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/vld_dll1/vld_dll1_vs14.vcxproj b/src/tests/vld_dll1/vld_dll1_vs14.vcxproj
index 3ca59b1d..8f170430 100644
--- a/src/tests/vld_dll1/vld_dll1_vs14.vcxproj
+++ b/src/tests/vld_dll1/vld_dll1_vs14.vcxproj
@@ -55,12 +55,12 @@
Win32Proj
vld_dll1
vld_dll1
- 10.0.19041.0
+ 10.0
DynamicLibrary
- v142
+ v143
Unicode
@@ -343,4 +343,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/vld_dll2/vld_dll2_vs14.vcxproj b/src/tests/vld_dll2/vld_dll2_vs14.vcxproj
index ab33f8dd..5ddbafbc 100644
--- a/src/tests/vld_dll2/vld_dll2_vs14.vcxproj
+++ b/src/tests/vld_dll2/vld_dll2_vs14.vcxproj
@@ -55,12 +55,12 @@
Win32Proj
vld_dll2
vld_dll2
- 10.0.19041.0
+ 10.0
DynamicLibrary
- v142
+ v143
Unicode
@@ -343,4 +343,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/vld_main/vld_main_vs14.vcxproj b/src/tests/vld_main/vld_main_vs14.vcxproj
index 448345a9..fae96ee8 100644
--- a/src/tests/vld_main/vld_main_vs14.vcxproj
+++ b/src/tests/vld_main/vld_main_vs14.vcxproj
@@ -55,12 +55,12 @@
Win32Proj
vld_main
vld_main
- 10.0.19041.0
+ 10.0
Application
- v142
+ v143
Unicode
@@ -340,4 +340,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/vld_main_test/vld_main_test_vs14.vcxproj b/src/tests/vld_main_test/vld_main_test_vs14.vcxproj
index 638541f4..e2730076 100644
--- a/src/tests/vld_main_test/vld_main_test_vs14.vcxproj
+++ b/src/tests/vld_main_test/vld_main_test_vs14.vcxproj
@@ -55,12 +55,12 @@
Win32Proj
vld_main_test
vld_main_test
- 10.0.19041.0
+ 10.0
Application
- v142
+ v143
Unicode
@@ -420,4 +420,4 @@
-
+
\ No newline at end of file
diff --git a/src/tests/vld_unload/vld_unload_vs14.vcxproj b/src/tests/vld_unload/vld_unload_vs14.vcxproj
index ecc523b4..82d31822 100644
--- a/src/tests/vld_unload/vld_unload_vs14.vcxproj
+++ b/src/tests/vld_unload/vld_unload_vs14.vcxproj
@@ -55,12 +55,12 @@
Win32Proj
vld_unload
vld_unload
- 10.0.19041.0
+ 10.0
Application
- v142
+ v143
Unicode
@@ -403,4 +403,4 @@
-
+
\ No newline at end of file
diff --git a/src/utility.cpp b/src/utility.cpp
index 481574bd..455ef056 100644
--- a/src/utility.cpp
+++ b/src/utility.cpp
@@ -1283,19 +1283,19 @@ HMODULE GetCallingModule(UINT_PTR pCaller )
{
HMODULE hModule = NULL;
- /*MEMORY_BASIC_INFORMATION mbi;
+ MEMORY_BASIC_INFORMATION mbi;
if (VirtualQuery((LPCVOID)pCaller, &mbi, sizeof(MEMORY_BASIC_INFORMATION)) == sizeof(MEMORY_BASIC_INFORMATION))
{
// the allocation base is the beginning of a PE file
hModule = (HMODULE)mbi.AllocationBase;
- }*/
+ }
- WIN32_MEMORY_REGION_INFORMATION memoryRegionInfo;
- if ( QueryVirtualMemoryInformation(GetCurrentProcess(), (LPCVOID)pCaller, MemoryRegionInfo, &memoryRegionInfo, sizeof(memoryRegionInfo), NULL) )
- {
- // the allocation base is the beginning of a PE file
- hModule = (HMODULE)memoryRegionInfo.AllocationBase;
- }
+ //WIN32_MEMORY_REGION_INFORMATION memoryRegionInfo;
+ //if ( QueryVirtualMemoryInformation(GetCurrentProcess(), (LPCVOID)pCaller, MemoryRegionInfo, &memoryRegionInfo, sizeof(memoryRegionInfo), NULL) )
+ //{
+ // // the allocation base is the beginning of a PE file
+ // hModule = (HMODULE)memoryRegionInfo.AllocationBase;
+ //}
return hModule;
}
diff --git a/src/vld.cpp b/src/vld.cpp
index 0225c496..e7429592 100644
--- a/src/vld.cpp
+++ b/src/vld.cpp
@@ -401,7 +401,7 @@ VisualLeakDetector::VisualLeakDetector ()
// Initialize global variables.
g_currentProcess = GetCurrentProcess();
g_currentThread = GetCurrentThread();
- g_processHeap = GetProcessHeap();
+ g_processHeap = GetProcessHeap();
LoaderLock ll;
@@ -646,6 +646,9 @@ VisualLeakDetector::~VisualLeakDetector ()
Report(L"No memory leaks detected.\n");
}
else {
+ if (m_options & VLD_OPT_AUDIO_ALERT_ON_LEAK) {
+ ::Beep(5000, 450);
+ }
Report(L"Visual Leak Detector detected %Iu memory leak", leaks_count);
Report((leaks_count > 1) ? L"s (%Iu bytes).\n" : L" (%Iu bytes).\n", m_curAlloc);
Report(L"Largest number used: %Iu bytes.\n", m_maxAlloc);
@@ -970,9 +973,9 @@ LPWSTR VisualLeakDetector::buildSymbolSearchPath ()
}
delete [] env;
}
-
-#if _MSC_VER > 2000
-#error Not supported VS
+
+#if _MSC_VER > 2000
+#error Not supported VS
#endif
// Append Visual Studio 2015/2013/2012/2010/2008 symbols cache directory.
// NOTE: This does not seem to exist for VS 2019 on Windows 10, but leaving it as is for now, updated to 2019 (changed 14->16)
@@ -1205,6 +1208,10 @@ VOID VisualLeakDetector::configure ()
if (LoadBoolOption(L"ValidateHeapAllocs", L"", inipath)) {
m_options |= VLD_OPT_VALIDATE_HEAPFREE;
}
+
+ if (LoadBoolOption(L"AudioAlertOnLeak", L"", inipath)) {
+ m_options |= VLD_OPT_AUDIO_ALERT_ON_LEAK;
+ }
}
// enabled - Determines if memory leak detection is enabled for the current
diff --git a/src/vld.vcxproj b/src/vld.vcxproj
index 02822c23..f4331f6d 100644
--- a/src/vld.vcxproj
+++ b/src/vld.vcxproj
@@ -26,13 +26,13 @@
true
x86
x64
- 10.0.19041.0
+ 10.0
vld
- v142
+ v143
diff --git a/src/vld_def.h b/src/vld_def.h
index 265de49c..9d0e79b1 100644
--- a/src/vld_def.h
+++ b/src/vld_def.h
@@ -42,6 +42,7 @@
#define VLD_OPT_SKIP_HEAPFREE_LEAKS 0x1000 // If set, VLD skip HeapFree memory leaks.
#define VLD_OPT_VALIDATE_HEAPFREE 0x2000 // If set, VLD verifies and reports heap consistency for HeapFree calls.
#define VLD_OPT_SKIP_CRTSTARTUP_LEAKS 0x4000 // If set, VLD skip crt srtartup memory leaks.
+#define VLD_OPT_AUDIO_ALERT_ON_LEAK 0x8000 // If set, VLD beeps when leaks are detected.
#define VLD_RPTHOOK_INSTALL 0
#define VLD_RPTHOOK_REMOVE 1
diff --git a/vld.ini b/vld.ini
index fa501129..bb90b2d5 100644
--- a/vld.ini
+++ b/vld.ini
@@ -169,3 +169,10 @@ SkipHeapFreeLeaks = no
; Default: yes
;
SkipCrtStartupLeaks = yes
+
+; Determines whether or not a beep is generated if leaks are found
+;
+; Valid Values: on, off
+; Default: off
+;
+AudioAlertOnLeak = off