internal TypeWrapperFactory GetTypeWrapperFactory() { if (factory == null) { lock (this) { if (factory == null) { #if CLASSGC if (dynamicAssemblies == null) { Interlocked.CompareExchange(ref dynamicAssemblies, new ConditionalWeakTable <Assembly, ClassLoaderWrapper>(), null); } typeToTypeWrapper = new Dictionary <Type, TypeWrapper>(); DynamicClassLoader instance = DynamicClassLoader.Get(this); dynamicAssemblies.Add(instance.ModuleBuilder.Assembly.ManifestModule.Assembly, this); this.factory = instance; #else factory = DynamicClassLoader.Get(this); #endif } } } return(factory); }