Commit a4abcea
committed
Fixed race condition in GetTypeInfo method
It was observed that a new ConvertTypeInfo instance was created twice for two threads simultaneously, adding the same type name to the assembly, which caused an ArgumentException "Duplicate type name within an assembly". This is the normal pattern when using a ConcurrentDictionary.
To resolve this, it is ensured that the new instance (emitting that type) is only created once. A normal Dictionary and locks are used now.1 parent 5293d7f commit a4abcea
2 files changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
848 | 848 | | |
849 | 849 | | |
850 | 850 | | |
851 | | - | |
852 | | - | |
| 851 | + | |
853 | 852 | | |
854 | 853 | | |
855 | 854 | | |
| |||
906 | 905 | | |
907 | 906 | | |
908 | 907 | | |
909 | | - | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
910 | 917 | | |
911 | 918 | | |
912 | 919 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
0 commit comments