File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 35
35
// You can specify all the values or you can default the Build and Revision Numbers
36
36
// by using the '*' as shown below:
37
37
// [assembly: AssemblyVersion("1.0.*")]
38
- [ assembly: AssemblyInformationalVersion ( "2.1.3 .0" ) ]
39
- [ assembly: AssemblyFileVersion ( "2.1.3 .0" ) ]
38
+ [ assembly: AssemblyInformationalVersion ( "2.1.4 .0" ) ]
39
+ [ assembly: AssemblyFileVersion ( "2.1.4 .0" ) ]
40
40
[ assembly: AssemblyVersion ( "1.0.0.0" ) ]
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ namespace Hudl.FFmpeg.Resources
11
11
/// </summary>
12
12
public class Resource
13
13
{
14
+ private static readonly object AllTypesLock = new object ( ) ;
14
15
private static readonly List < Type > AllTypes = new List < Type > ( ) ;
15
16
16
17
/// <summary>
@@ -78,18 +79,21 @@ public static IContainer From(string fullPath)
78
79
private static IContainer From ( string filePath , string fileName )
79
80
{
80
81
var fileExtension = Helpers . GetExtensionFromFullName ( fileName ) ;
81
- if ( AllTypes . Count == 0 )
82
- {
83
- AllTypes . AddRange ( GetTypes < IContainer > ( ) ) ;
84
- }
82
+ lock ( AllTypesLock )
83
+ {
84
+ if ( AllTypes . Count == 0 )
85
+ {
86
+ AllTypes . AddRange ( GetTypes < IContainer > ( ) ) ;
87
+ }
88
+ }
85
89
86
- var correcTContainer = AllTypes . FirstOrDefault ( t => t . Name . ToUpper ( ) == fileExtension . ToUpper ( ) ) ;
87
- if ( correcTContainer == null )
90
+ var correctContainer = AllTypes . FirstOrDefault ( t => t . Name . ToUpper ( ) == fileExtension . ToUpper ( ) ) ;
91
+ if ( correctContainer == null )
88
92
{
89
93
throw new InvalidOperationException ( "Cannot derive resource type from path provided." ) ;
90
94
}
91
95
92
- var newInstance = ( IContainer ) Activator . CreateInstance ( correcTContainer ) ;
96
+ var newInstance = ( IContainer ) Activator . CreateInstance ( correctContainer ) ;
93
97
newInstance . Path = filePath ;
94
98
newInstance . Name = fileName ;
95
99
return newInstance ;
You can’t perform that action at this time.
0 commit comments