소스 검색

Don't create multiple instances of the same type

Bond_009 6 년 전
부모
커밋
d409623086
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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)
             {