diff --git a/texthook/texthook.cc b/texthook/texthook.cc index 584dfdd..5f8d10b 100644 --- a/texthook/texthook.cc +++ b/texthook/texthook.cc @@ -292,10 +292,10 @@ void TextHook::RemoveReadCode() void TextHook::Clear() { if (address == 0) return; - NotifyHookRemove(address, hp.name); - std::scoped_lock lock(viewMutex); if (hp.type & DIRECT_READ) RemoveReadCode(); else RemoveHookCode(); + NotifyHookRemove(address, hp.name); + std::scoped_lock lock(viewMutex); memset(&hp, 0, sizeof(HookParam)); address = 0; }