Skip to content

Commit

Permalink
Addendum to previous commit
Browse files Browse the repository at this point in the history
Fix handle leak
  • Loading branch information
codenulls committed Jun 27, 2019
1 parent e8ddd2c commit 48878af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1536,13 +1536,14 @@ void __cdecl OnMY_CAnimManager_CreateAnimAssocGroups_Protect(CAnimBlendAssocGrou
{
if (pGroupInterface->groupID == groupID)
{
void* pIdOffsetMember = reinterpret_cast<void*>(&pGroupInterface->iIDOffset);
HANDLE mainThread = OpenThread(THREAD_ALL_ACCESS, TRUE, SharedUtil::GetMainThreadId());

assert(mainThread != NULL);

void* pIdOffsetMember = reinterpret_cast<void*>(&pGroupInterface->iIDOffset);
SetHardwareBreakpoint(mainThread, HWBRK_TYPE_WRITE, HWBRK_SIZE_4, pIdOffsetMember);

CloseHandle(mainThread);

LogEvent(511, "Breakpoint", "Hardware Breakpoint set on WRITE access",
SString("groupID: %u | pGroupInterface: %#.8x, pIdOffsetMember = %#.8x | iIDOffset: %d", groupID, pGroupInterface, pIdOffsetMember,
pGroupInterface->iIDOffset),
Expand Down

0 comments on commit 48878af

Please sign in to comment.