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
Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on GitHub
to continue tracking issues. Bugzilla will remain available for
reference in read-only mode. We will continue to work on open Bugzilla
bugs, copy them to the new locations as needed for follow-up, and add
the new items under Related Links.
Create a new report for Bug 25132 on Developer
Community or GitHub if you have new information to add and do not yet see a matching
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Our sincere thanks to everyone who has contributed on this bug tracker
over the years. Thanks also for your understanding as we make these
adjustments and improvements for the future.