File tree Expand file tree Collapse file tree 4 files changed +50
-0
lines changed Expand file tree Collapse file tree 4 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 32
32
<WarningLevel >4</WarningLevel >
33
33
<DocumentationFile />
34
34
</PropertyGroup >
35
+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Leaks|AnyCPU' " >
36
+ <DebugSymbols >true</DebugSymbols >
37
+ <DebugType >full</DebugType >
38
+ <Optimize >false</Optimize >
39
+ <OutputPath >bin\Leaks\</OutputPath >
40
+ <DefineConstants >TRACE;DEBUG;NET35</DefineConstants >
41
+ <ErrorReport >prompt</ErrorReport >
42
+ <WarningLevel >4</WarningLevel >
43
+ <DocumentationFile />
44
+ </PropertyGroup >
35
45
<ItemGroup >
36
46
<Reference Include =" System" />
37
47
<Reference Include =" System.Core" />
Original file line number Diff line number Diff line change @@ -8,15 +8,20 @@ EndProject
8
8
Global
9
9
GlobalSection (SolutionConfigurationPlatforms ) = preSolution
10
10
Debug| Any CPU = Debug| Any CPU
11
+ Leaks| Any CPU = Leaks| Any CPU
11
12
Release| Any CPU = Release| Any CPU
12
13
EndGlobalSection
13
14
GlobalSection (ProjectConfigurationPlatforms ) = postSolution
14
15
{EE6ED99F-CB12-4683-B055-D28FC7357A34} .Debug| Any CPU .ActiveCfg = Debug| Any CPU
15
16
{EE6ED99F-CB12-4683-B055-D28FC7357A34} .Debug| Any CPU .Build .0 = Debug| Any CPU
17
+ {EE6ED99F-CB12-4683-B055-D28FC7357A34} .Leaks| Any CPU .ActiveCfg = Leaks| Any CPU
18
+ {EE6ED99F-CB12-4683-B055-D28FC7357A34} .Leaks| Any CPU .Build .0 = Leaks| Any CPU
16
19
{EE6ED99F-CB12-4683-B055-D28FC7357A34} .Release| Any CPU .ActiveCfg = Release| Any CPU
17
20
{EE6ED99F-CB12-4683-B055-D28FC7357A34} .Release| Any CPU .Build .0 = Release| Any CPU
18
21
{286E63EB-04DD-4ADE-88D6-041B57800761} .Debug| Any CPU .ActiveCfg = Debug| Any CPU
19
22
{286E63EB-04DD-4ADE-88D6-041B57800761} .Debug| Any CPU .Build .0 = Debug| Any CPU
23
+ {286E63EB-04DD-4ADE-88D6-041B57800761} .Leaks| Any CPU .ActiveCfg = Leaks| Any CPU
24
+ {286E63EB-04DD-4ADE-88D6-041B57800761} .Leaks| Any CPU .Build .0 = Leaks| Any CPU
20
25
{286E63EB-04DD-4ADE-88D6-041B57800761} .Release| Any CPU .ActiveCfg = Release| Any CPU
21
26
{286E63EB-04DD-4ADE-88D6-041B57800761} .Release| Any CPU .Build .0 = Release| Any CPU
22
27
EndGlobalSection
Original file line number Diff line number Diff line change 1
1
using System ;
2
+ using System . Diagnostics ;
2
3
using System . Runtime . InteropServices ;
3
4
4
5
namespace LibGit2Sharp . Core . Handles
5
6
{
6
7
internal abstract class SafeHandleBase : SafeHandle
7
8
{
9
+ #if LEAKS
10
+ private readonly string trace ;
11
+ #endif
12
+
8
13
protected SafeHandleBase ( )
9
14
: base ( IntPtr . Zero , true )
10
15
{
16
+ #if LEAKS
17
+ trace = new StackTrace ( 2 , true ) . ToString ( ) ;
18
+ #endif
19
+ }
20
+
21
+ protected override void Dispose ( bool disposing )
22
+ {
23
+ #if DEBUG
24
+ if ( ! disposing && ! IsInvalid )
25
+ {
26
+ Trace . WriteLine ( string . Format ( "A {0} handle wrapper has not been properly disposed." , GetType ( ) . Name ) ) ;
27
+ #if LEAKS
28
+ Trace . WriteLine ( trace ) ;
29
+ #endif
30
+ Trace . WriteLine ( "" ) ;
31
+ }
32
+ #endif
33
+ base . Dispose ( disposing ) ;
11
34
}
12
35
13
36
public override bool IsInvalid
Original file line number Diff line number Diff line change 37
37
<TreatWarningsAsErrors >false</TreatWarningsAsErrors >
38
38
<DocumentationFile >bin\Release\LibGit2Sharp.xml</DocumentationFile >
39
39
</PropertyGroup >
40
+ <PropertyGroup Condition =" '$(Configuration)|$(Platform)' == 'Leaks|AnyCPU'" >
41
+ <DebugSymbols >true</DebugSymbols >
42
+ <DebugType >full</DebugType >
43
+ <Optimize >false</Optimize >
44
+ <OutputPath >bin\Leaks\</OutputPath >
45
+ <DefineConstants >TRACE;DEBUG;NET35;LEAKS</DefineConstants >
46
+ <ErrorReport >prompt</ErrorReport >
47
+ <WarningLevel >4</WarningLevel >
48
+ <TreatWarningsAsErrors >false</TreatWarningsAsErrors >
49
+ <AllowUnsafeBlocks >true</AllowUnsafeBlocks >
50
+ <CodeAnalysisRuleSet >AllRules.ruleset</CodeAnalysisRuleSet >
51
+ </PropertyGroup >
40
52
<ItemGroup >
41
53
<Reference Include =" System" />
42
54
<Reference Include =" System.Core" />
You can’t perform that action at this time.
0 commit comments