- fixed a massive deadlock when TitanEngine was used in various processes

- now removes breakpoints before detaching
This commit is contained in:
Mr. eXoDia 2014-04-16 20:31:12 +02:00
parent bc2240d1c1
commit 6d5480559a
2 changed files with 7 additions and 1 deletions

View File

@ -4,7 +4,11 @@
MutexLocker::MutexLocker(const char* name) MutexLocker::MutexLocker(const char* name)
{ {
gMutex=CreateMutexA(0, false, 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);
bUnlocked=false; bUnlocked=false;
WaitForSingleObject(gMutex, INFINITE); WaitForSingleObject(gMutex, INFINITE);
} }

View File

@ -273,6 +273,8 @@ __declspec(dllexport) bool TITCALL DetachDebugger(DWORD ProcessId)
LPVOID funcDebugActiveProcessStop = NULL; LPVOID funcDebugActiveProcessStop = NULL;
bool FuncReturn = false; bool FuncReturn = false;
RemoveAllBreakPoints(UE_OPTION_REMOVEALL);
if(ProcessId != NULL) if(ProcessId != NULL)
{ {
funcDebugActiveProcessStop = GetProcAddress(GetModuleHandleA("kernel32.dll"), "DebugActiveProcessStop"); funcDebugActiveProcessStop = GetProcAddress(GetModuleHandleA("kernel32.dll"), "DebugActiveProcessStop");