Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions lib/cppformat/format.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
<Keyword>Win32Proj</Keyword>
<Platform>Win32</Platform>
<ProjectName>libformat</ProjectName>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<RootNamespace>libformat</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand Down
2 changes: 1 addition & 1 deletion setup/build_version.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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/..

Expand Down
10 changes: 5 additions & 5 deletions setup/version.h
Original file line number Diff line number Diff line change
@@ -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
160 changes: 87 additions & 73 deletions setup/vld-setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions src/tests/basics/basics.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
<Keyword>Win32Proj</Keyword>
<RootNamespace>test_basics</RootNamespace>
<ProjectName>test_basics</ProjectName>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -342,4 +342,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
6 changes: 3 additions & 3 deletions src/tests/corruption/corruption.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
<ProjectGuid>{87911ED6-84BC-4526-9654-A4FF4E0EDF52}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>corruption</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>corruption</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -315,4 +315,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
6 changes: 3 additions & 3 deletions src/tests/dynamic_app/dynamic_app.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
<ProjectGuid>{5C25E1C8-00CB-4E0A-9BEC-952F0A6E5DCA}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>dynamic_app</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>dynamic_app</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -325,4 +325,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
6 changes: 3 additions & 3 deletions src/tests/dynamic_dll/dynamic.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@
<Keyword>Win32Proj</Keyword>
<RootNamespace>dynamic</RootNamespace>
<ProjectName>dynamic</ProjectName>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
Expand Down Expand Up @@ -335,4 +335,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
6 changes: 3 additions & 3 deletions src/tests/mfc/vldmfc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{A231973E-072A-428E-982E-5363ADD1CDE2}</ProjectGuid>
<Keyword>MFCProj</Keyword>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>vldmfc</ProjectName>
<RootNamespace>vldmfc</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<UseOfMfc>Dynamic</UseOfMfc>
Expand Down Expand Up @@ -290,4 +290,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
Loading