[.NET] Fix a pretty big memory leak