diff --git a/uppsrc/ide/Debuggers/Pdb.cpp b/uppsrc/ide/Debuggers/Pdb.cpp index b7e14c844..83d55536c 100644 --- a/uppsrc/ide/Debuggers/Pdb.cpp +++ b/uppsrc/ide/Debuggers/Pdb.cpp @@ -302,18 +302,6 @@ Pdb::Pdb() Load(callback(this, &Pdb::SerializeSession), ss); } -void Pdb::CleanupOnExit() -{ - if(hProcess != INVALID_HANDLE_VALUE) { - while(threads.GetCount()) - RemoveThread(threads.GetKey(0)); - UnloadModuleSymbols(); - SymCleanup(hProcess); - CloseHandle(hProcess); - hProcess = INVALID_HANDLE_VALUE; - } -} - void Pdb::CopyStack() { String s; @@ -340,7 +328,11 @@ Pdb::~Pdb() if(hProcess != INVALID_HANDLE_VALUE) { DebugActiveProcessStop(processid); TerminateProcess(hProcess, 0); - CleanupOnExit(); + while(threads.GetCount()) + RemoveThread(threads.GetKey(0)); // To CloseHandle + UnloadModuleSymbols(); + SymCleanup(hProcess); + CloseHandle(hProcess); } StoreToGlobal(*this, CONFIGNAME); IdeRemoveBottom(*this); diff --git a/uppsrc/ide/Debuggers/Pdb.h b/uppsrc/ide/Debuggers/Pdb.h index 917227142..8c5196f24 100644 --- a/uppsrc/ide/Debuggers/Pdb.h +++ b/uppsrc/ide/Debuggers/Pdb.h @@ -254,7 +254,6 @@ struct Pdb : Debugger, ParentCtrl { void LoadModuleInfo(); int FindModuleIndex(adr_t base); void UnloadModuleSymbols(); - void CleanupOnExit(); void AddThread(dword dwThreadId, HANDLE hThread); void RemoveThread(dword dwThreadId); void Lock();