Fixed: Memory leak

Explicitly register concrete types as transient

(cherry picked from commit f097d30b095d89681eb1aede2e88c4fdefcab516)
(cherry picked from commit 47b23417e0b2dad153d16f1a8846a3a95ff9adcc)
(cherry picked from commit 876376cb77375e5d5b964ff215a7f7e2f730fa0a)
pull/6682/head
ta264 3 years ago committed by Qstick
parent 06e2d5b3c3
commit d6967a786f

@ -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