public void RemoveHook(uint addr, Action<uint> hook)
{
lock(hooks)
{
HookDescriptor descriptor;
if(!hooks.TryGetValue(addr, out descriptor) || !descriptor.RemoveCallback(hook))
{
this.Log(LogLevel.Warning, "Tried to remove not existing hook from address 0x{0:x}", addr);
return;
}
if(descriptor.IsEmpty)
{
hooks.Remove(addr);
}
}
}