Skip to content

Commit c4777d3

Browse files
committed
Init callbacks!
1 parent fec86c5 commit c4777d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

LibGit2Sharp/Filter.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public Filter(string name, string attributes, int version)
3636
{
3737
attributes = EncodingMarshaler.FromManaged(Encoding.UTF8, attributes),
3838
version = (uint)version,
39+
init = FilterCallbacks.InitializeCallback,
3940
shutdown = FilterCallbacks.ShutdownCallback,
4041
};
4142

@@ -99,11 +100,20 @@ private static class FilterCallbacks
99100
// to native memory with StructureToPtr), we need to bind to static delegates. If at construction time
100101
// we were to bind to the methods directly, that's the same as newing up a fresh delegate every time.
101102
// Those delegates won't be rooted in the object graph and can be collected as soon as StructureToPtr finishes.
103+
104+
public static readonly GitFilter.git_filter_init_fn InitializeCallback = Initialize;
102105
public static readonly GitFilter.git_filter_shutdown_fn ShutdownCallback = Shutdown;
103106

107+
108+
private static int Initialize(IntPtr filter)
109+
{
110+
return 0;
111+
}
112+
104113
private static void Shutdown(IntPtr gitFilter)
105114
{
106115
}
116+
107117
}
108118
}
109119

0 commit comments

Comments
 (0)