Skip to content

Commit c8e8b69

Browse files
Mattiwattimrexodia
authored andcommitted
Remove static global handle 'hProcess' in debugger.cpp; it is only used in one place as argument to SafeSymCleanup(). Use fdProcessInfo->hProcess instead
1 parent 27a9266 commit c8e8b69

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/dbg/debugger.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ static bool bFreezeStack = false;
5656
static std::vector<ExceptionRange> ignoredExceptionRange;
5757
static HANDLE hEvent = 0;
5858
static duint tidToResume = 0;
59-
static HANDLE hProcess = 0;
6059
static HANDLE hMemMapThread = 0;
6160
static bool bStopMemMapThread = false;
6261
static HANDLE hTimeWastedCounterThread = 0;
@@ -1987,7 +1986,6 @@ static void cbAttachDebugger()
19871986
cmddirectexec(StringUtils::sprintf("resumethread %p", tidToResume).c_str());
19881987
tidToResume = 0;
19891988
}
1990-
hProcess = fdProcessInfo->hProcess;
19911989
varset("$hp", (duint)fdProcessInfo->hProcess, true);
19921990
varset("$pid", fdProcessInfo->dwProcessId, true);
19931991
}
@@ -2722,7 +2720,6 @@ static void debugLoopFunction(void* lpParameter, bool attach)
27222720
}
27232721
else
27242722
{
2725-
hProcess = fdProcessInfo->hProcess;
27262723
DebugLoop();
27272724
}
27282725

@@ -2732,7 +2729,8 @@ static void debugLoopFunction(void* lpParameter, bool attach)
27322729
plugincbcall(CB_STOPDEBUG, &stopInfo);
27332730

27342731
//cleanup dbghelp
2735-
SafeSymCleanup(hProcess);
2732+
if(fdProcessInfo->hProcess != nullptr)
2733+
SafeSymCleanup(fdProcessInfo->hProcess);
27362734

27372735
//message the user/do final stuff
27382736
RemoveAllBreakPoints(UE_OPTION_REMOVEALL); //remove all breakpoints

0 commit comments

Comments
 (0)