fix: make HookManager.TrackedHooks thread-safe, might fix invalid CLR state

This commit is contained in:
goaaats 2022-01-12 18:33:40 +01:00
parent af4a25c74b
commit 0e95424704
No known key found for this signature in database
GPG key ID: F18F057873895461
4 changed files with 16 additions and 6 deletions

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
@ -28,7 +29,7 @@ namespace Dalamud.Hooking.Internal
/// <summary>
/// Gets a static list of tracked and registered hooks.
/// </summary>
internal static List<HookInfo> TrackedHooks { get; } = new();
internal static ConcurrentDictionary<Guid, HookInfo> TrackedHooks { get; } = new();
/// <summary>
/// Gets a static dictionary of original code for a hooked address.