Explorar o código

Don't create multiple instances of the same type

Bond_009 %!s(int64=6) %!d(string=hai) anos
pai
achega
d409623086
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      Emby.Server.Implementations/ApplicationHost.cs

+ 2 - 1
Emby.Server.Implementations/ApplicationHost.cs

@@ -512,7 +512,8 @@ namespace Emby.Server.Implementations
             var parts = GetExportTypes<T>()
                 .Select(x => CreateInstanceSafe(x))
                 .Where(i => i != null)
-                .Cast<T>();
+                .Cast<T>()
+                .ToList(); // Convert to list so this isn't executed for each iteration
 
             if (manageLifetime)
             {