In  we're trying to add some leaks handling in LibGit2Sharp. Based on debugging, I noticed that SafeHandle.Dispose(bool) is always called with true, so code at  is not gathering any leaks, whilst it does on .NET. Compare  and .
Probably as easy as importing reference source?
 - https://github.com/libgit2/libgit2sharp/pull/883
 - https://github.com/libgit2/libgit2sharp/blob/ntk/leaks/LibGit2Sharp/Core/Handles/SafeHandleBase.cs#L93-L102
 - https://ci.appveyor.com/project/nulltoken/libgit2sharp/build/108/job/0hywvy5jgksvsxtt
 - https://travis-ci.org/libgit2/libgit2sharp/jobs/43222585
I'd need some help to track down what is the source of the issue.
Firstly. SafeHandle.Dispose(true) only means that the handle is disposed manually (which is good) and not via GC.
The link at  is not working for me and some sort of repro (small if possible) would be helpful.
This is the code, sorry. The PR got merged.
I've set up a test repository to show this bug. MS.NET throws an exception, Mono does not.
Fixed in master