FpDebug: Fix a potential double-free

git-svn-id: trunk@62320 -
This commit is contained in:
martin 2019-12-03 19:40:41 +00:00
parent b206664b05
commit d506a29b8c

View File

@ -824,7 +824,7 @@ begin
exit;
end;
FCommandToBeFreed.Free;
FreeAndNil(FCommandToBeFreed);
if FCommand <> nil then
FCommand.DoBeforeLoopStart;
@ -1069,7 +1069,8 @@ begin
OnHitBreakpointEvent(continue, nil);
end;
if not &continue then begin
if (not &continue) and (FCommand <> nil) then begin
assert(FCommandToBeFreed=nil, 'TDbgController.SendEvents: FCommandToBeFreed=nil');
FCommandToBeFreed := FCommand;
FCommand := nil;
end;