File tree 4 files changed +5
-10
lines changed 4 files changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ namespace LibGit2Sharp.Core
6
6
{
7
7
internal class Utf8Marshaler : ICustomMarshaler
8
8
{
9
- static Utf8Marshaler staticInstance ;
10
- readonly bool ownsPointer ;
9
+ private static readonly Utf8Marshaler staticInstance = new Utf8Marshaler ( ) ;
10
+ private readonly bool ownsPointer ;
11
11
12
12
internal Utf8Marshaler ( bool ownsPointer = false )
13
13
{
@@ -89,11 +89,6 @@ public int GetNativeDataSize()
89
89
90
90
public static ICustomMarshaler GetInstance ( string cookie )
91
91
{
92
- if ( staticInstance == null )
93
- {
94
- return staticInstance = new Utf8Marshaler ( ) ;
95
- }
96
-
97
92
return staticInstance ;
98
93
}
99
94
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public class Index : IEnumerable<IndexEntry>
17
17
private readonly IndexSafeHandle handle ;
18
18
private readonly Repository repo ;
19
19
20
- private static readonly Utf8Marshaler utf8Marshaler = new Utf8Marshaler ( ) ;
20
+ private static readonly Utf8Marshaler utf8Marshaler = new Utf8Marshaler ( true ) ;
21
21
22
22
internal Index ( Repository repo )
23
23
{
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ public class IndexEntry : IEquatable<IndexEntry>
14
14
15
15
private Func < FileStatus > state ;
16
16
17
- private static readonly Utf8Marshaler marshaler = new Utf8Marshaler ( ) ;
17
+ private static readonly Utf8Marshaler marshaler = ( Utf8Marshaler ) Utf8Marshaler . GetInstance ( string . Empty ) ;
18
18
19
19
/// <summary>
20
20
/// State of the version of the <see cref = "Blob" /> pointed at by this <see cref = "IndexEntry" />,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ public class Signature
13
13
private readonly string name ;
14
14
private readonly string email ;
15
15
16
- private static readonly Utf8Marshaler marshaler = new Utf8Marshaler ( ) ;
16
+ private static readonly Utf8Marshaler marshaler = ( Utf8Marshaler ) Utf8Marshaler . GetInstance ( string . Empty ) ;
17
17
18
18
internal Signature ( IntPtr signaturePtr )
19
19
{
You can’t perform that action at this time.
0 commit comments