From 47b23417e0b2dad153d16f1a8846a3a95ff9adcc Mon Sep 17 00:00:00 2001 From: ta264 Date: Tue, 20 Apr 2021 21:21:32 +0100 Subject: [PATCH] Fixed: Memory leak Explicitly register concrete types as transient (cherry picked from commit f097d30b095d89681eb1aede2e88c4fdefcab516) --- src/NzbDrone.Common/Composition/Extensions.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/NzbDrone.Common/Composition/Extensions.cs b/src/NzbDrone.Common/Composition/Extensions.cs index d3cc6b52c..52ebd9040 100644 --- a/src/NzbDrone.Common/Composition/Extensions.cs +++ b/src/NzbDrone.Common/Composition/Extensions.cs @@ -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);