Fixed: Memory leak

Explicitly register concrete types as transient
pull/40/head
ta264 3 years ago
parent b83621ce49
commit f097d30b09

@ -28,6 +28,10 @@ namespace NzbDrone.Common.Composition.Extensions
serviceTypeCondition: type => type.IsInterface && !string.IsNullOrWhiteSpace(type.FullName) && !type.FullName.StartsWith("System"),
reuse: Reuse.Singleton);
container.RegisterMany(assemblies,
serviceTypeCondition: type => !type.IsInterface && !string.IsNullOrWhiteSpace(type.FullName) && !type.FullName.StartsWith("System"),
reuse: Reuse.Transient);
var knownTypes = new KnownTypes(assemblies.SelectMany(x => x.GetTypes()).ToList());
container.RegisterInstance(knownTypes);

Loading…
Cancel
Save