mirror of https://github.com/x64dbg/TitanEngine
fixed the most ugly bug ever (handle leaks...)
This commit is contained in:
parent
8ca6c8d869
commit
cbe59495aa
|
|
@ -7,8 +7,8 @@ MutexLocker::MutexLocker(const char* name)
|
|||
int len=strlen(name);
|
||||
DynBuf newNameBuf(len+20);
|
||||
char* newName = (char*)newNameBuf.GetPtr();
|
||||
sprintf(newName, "%s%X", name, GetCurrentProcessId());
|
||||
gMutex=CreateMutexA(0, false, newName);
|
||||
sprintf(newName, "Local\\%s%X", name, GetCurrentProcessId());
|
||||
gMutex=CreateMutexA(0, true, newName);
|
||||
bUnlocked=false;
|
||||
WaitForSingleObject(gMutex, INFINITE);
|
||||
}
|
||||
|
|
@ -17,6 +17,7 @@ MutexLocker::~MutexLocker()
|
|||
{
|
||||
if(!bUnlocked)
|
||||
ReleaseMutex(gMutex);
|
||||
CloseHandle(gMutex);
|
||||
}
|
||||
|
||||
void MutexLocker::relock()
|
||||
|
|
|
|||
Loading…
Reference in New Issue