FpDebug: Fix a leak when stopping/reseting the debugger under heavy multithreaded load. (Windows may have queued events, then the next pause may not be the expected ExitProcess, and clean-up is not triggered.

git-svn-id: trunk@62032 -
This commit is contained in:
martin 2019-10-11 12:07:16 +00:00
parent 9cad1b3feb
commit bb9f614179

View File

@ -818,7 +818,7 @@ var
i: Integer;
begin
inherited DoStateChange(AOldState);
if Debugger.State in [dsPause, dsInternalPause] then
if Debugger.State in [dsPause, dsInternalPause, dsStop] then
begin
if FDelayedRemoveBreakpointList.Count>0 then begin
debuglnEnter(DBG_BREAKPOINTS, ['TFPBreakpoints.DoStateChange REMOVE DELAYED']);
@ -2254,6 +2254,12 @@ end;
destructor TFpDebugDebugger.Destroy;
begin
if state in [dsPause, dsInternalPause] then
try
FreeAndNil(FRaiseExceptionBreakpoint);
SetState(dsStop);
except
end;
if assigned(FFpDebugThread) then
FreeDebugThread;
ClearWatchEvalList;