mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-01-03 06:13:40 +01:00
fix: make HookManager.TrackedHooks thread-safe, might fix invalid CLR state
This commit is contained in:
parent
af4a25c74b
commit
0e95424704
4 changed files with 16 additions and 6 deletions
|
|
@ -49,7 +49,7 @@ namespace Dalamud.Hooking
|
|||
this.statsMethod.GetILGenerator().Emit(OpCodes.Ret);
|
||||
var dele = this.statsMethod.CreateDelegate(typeof(Action));
|
||||
|
||||
HookManager.TrackedHooks.Add(new HookInfo(this, dele, Assembly.GetCallingAssembly()));
|
||||
HookManager.TrackedHooks.TryAdd(Guid.NewGuid(), new HookInfo(this, dele, Assembly.GetCallingAssembly()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -79,7 +79,7 @@ namespace Dalamud.Hooking
|
|||
this.statsMethod.GetILGenerator().Emit(OpCodes.Ret);
|
||||
var dele = this.statsMethod.CreateDelegate(typeof(Action));
|
||||
|
||||
HookManager.TrackedHooks.Add(new HookInfo(this, dele, Assembly.GetCallingAssembly()));
|
||||
HookManager.TrackedHooks.TryAdd(Guid.NewGuid(), new HookInfo(this, dele, Assembly.GetCallingAssembly()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue