Skip to content
This repository
Browse code

Remove the GlobalAssemblyResolver

  • Loading branch information...
commit e287e4048dfa2e0b0b0c03afe7056fbea1a2f1d7 1 parent 874a39c
Jb Evain authored
5 Mono.Cecil/DefaultAssemblyResolver.cs
@@ -31,11 +31,6 @@
31 31
32 32 namespace Mono.Cecil {
33 33
34   - public static class GlobalAssemblyResolver {
35   -
36   - public static readonly IAssemblyResolver Instance = new DefaultAssemblyResolver ();
37   - }
38   -
39 34 public class DefaultAssemblyResolver : BaseAssemblyResolver {
40 35
41 36 readonly IDictionary<string, AssemblyDefinition> cache;
2  Mono.Cecil/ModuleDefinition.cs
@@ -428,7 +428,7 @@ internal ModuleDefinition ()
428 428 {
429 429 this.MetadataSystem = new MetadataSystem ();
430 430 this.token = new MetadataToken (TokenType.Module, 1);
431   - this.assembly_resolver = GlobalAssemblyResolver.Instance;
  431 + this.assembly_resolver = new DefaultAssemblyResolver();
432 432 }
433 433
434 434 internal ModuleDefinition (Image image)

0 comments on commit e287e40

Miguel de Icaza

In the context of merging this into Mono, this would break the API, is there a reason for this change?

Jb Evain

Yes, a global caching resolver introduced a few issues, but mainly, there was no good way to control its cache, effectively making it a big memory leak if the user was not using its own resolver.

I'll review how it's used inside Mono and fix it accordingly.

Please sign in to comment.
Something went wrong with that request. Please try again.