8000 Eagerly detect unreleased unmanaged resources · MicrosoftWebMatrix/libgit2sharp@7cd4c55 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7cd4c55

Browse files
yorahnulltoken
authored andcommitted
Eagerly detect unreleased unmanaged resources
This is only active in the LEAKS build configuration. This helps detect errors that are now more visible since libgit2#330
1 parent 81d1490 commit 7cd4c55

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<DebugType>full</DebugType>
3838
<Optimize>false</Optimize>
3939
<OutputPath>bin\Leaks\</OutputPath>
40-
<DefineConstants>TRACE;DEBUG;NET35</DefineConstants>
40+
<DefineConstants>TRACE;DEBUG;NET35;LEAKS</DefineConstants>
4141
<ErrorReport>prompt</ErrorReport>
4242
<WarningLevel>4</WarningLevel>
4343
<DocumentationFile />

LibGit2Sharp.Tests/TestHelpers/BaseFixture.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ public void Register(string directoryPath)
9393

9494
public void Dispose()
9595
{
96+
#if LEAKS
97+
GC.Collect();
98+
#endif
99+
96100
foreach (string directory in directories)
97101
{
98102
DirectoryHelper.DeleteDirectory(directory);

0 commit comments

Comments
 (0)
0