Skip to content

Commit a8b201d

Browse files
committed
Add delegate for shutdown
1 parent e67bdcc commit a8b201d

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

LibGit2Sharp/Core/GitFilter.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,34 @@ namespace LibGit2Sharp.Core
77
/// A git filter
88
/// </summary>
99
[StructLayout(LayoutKind.Sequential)]
10-
internal struct GitFilter
10+
internal class GitFilter
1111
{
1212
public uint version;
1313

1414
public IntPtr attributes;
1515

1616
public IntPtr init;
1717

18-
public IntPtr shutdown;
18+
public git_filter_shutdown_fn shutdown;
1919

2020
public IntPtr check;
2121

2222
public IntPtr apply;
2323

2424
public IntPtr cleanup;
25+
26+
/* The libgit2 structure definition ends here. Subsequent fields are for libgit2sharp bookkeeping. */
27+
28+
/// <summary>
29+
/// Shutdown callback on filter
30+
///
31+
/// Specified as `filter.shutdown`, this is an optional callback invoked
32+
/// when the filter is unregistered or when libgit2 is shutting down. It
33+
/// will be called once at most and should release resources as needed.
34+
/// This may be called even if the `initialize` callback was not made.
35+
/// Typically this function will free the `git_filter` object itself.
36+
/// </summary>
37+
public delegate void git_filter_shutdown_fn(IntPtr filter);
38+
2539
}
2640
}

0 commit comments

Comments
 (0)