Changed the way the ZeroHashtable works to prevent locking or concurrency issues.
Showing
1 changed file
with
3 additions
and
7 deletions
| ... | @@ -75,7 +75,7 @@ namespace LIL_VSTT_Plugins | ... | @@ -75,7 +75,7 @@ namespace LIL_VSTT_Plugins |
| 75 | System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(typeof(System.Net.Security.SslStream)); | 75 | System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(typeof(System.Net.Security.SslStream)); |
| 76 | Type t = asm.GetType("System.Net.Security.SslSessionsCache"); | 76 | Type t = asm.GetType("System.Net.Security.SslSessionsCache"); |
| 77 | System.Reflection.FieldInfo f = t.GetField("s_CachedCreds", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); | 77 | System.Reflection.FieldInfo f = t.GetField("s_CachedCreds", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); |
| 78 | f.SetValue(null, new ZeroHashtable(32)); | 78 | f.SetValue(null, new ZeroHashtable()); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void undoIt() | 81 | void undoIt() |
| ... | @@ -89,12 +89,8 @@ namespace LIL_VSTT_Plugins | ... | @@ -89,12 +89,8 @@ namespace LIL_VSTT_Plugins |
| 89 | 89 | ||
| 90 | public class ZeroHashtable : System.Collections.Hashtable | 90 | public class ZeroHashtable : System.Collections.Hashtable |
| 91 | { | 91 | { |
| 92 | public ZeroHashtable(int capacity) : base(capacity) { } | 92 | public override void Add(object key, object value) { return; } |
| 93 | 93 | public override object this[object key] { get { return null; } set { return; } } | |
| 94 | public override int Count | ||
| 95 | { | ||
| 96 | get { if(base.Count % 32 == 0) this.Clear(); return 0; } | ||
| 97 | } | ||
| 98 | } | 94 | } |
| 99 | 95 | ||
| 100 | /// <summary> | 96 | /// <summary> | ... | ... |
-
Please register or sign in to post a comment