1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-25 09:12:17 +00:00

Fixed: Memory leak

Explicitly register concrete types as transient

(cherry picked from commit f097d30b095d89681eb1aede2e88c4fdefcab516)
(cherry picked from commit 47b23417e0b2dad153d16f1a8846a3a95ff9adcc)
This commit is contained in:
ta264 2021-08-04 21:42:41 +01:00 committed by Qstick
parent ccc417e62e
commit 876376cb77

View file

@ -28,6 +28,10 @@ public static IContainer AutoAddServices(this IContainer container, List<string>
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);