diff --git a/components/fpdebug/fpdbgcontroller.pas b/components/fpdebug/fpdbgcontroller.pas index 92ce2901e4..1bb53159c1 100644 --- a/components/fpdebug/fpdbgcontroller.pas +++ b/components/fpdebug/fpdbgcontroller.pas @@ -1713,7 +1713,9 @@ begin if FPDEvent=deExitProcess then begin FreeAndNil(FCommand); if assigned(FOnThreadProcessLoopCycleEvent) then begin + CurCmd := nil; FOnThreadProcessLoopCycleEvent(AExit, FPDEvent, CurCmd, IsFinished); + FreeAndNil(CurCmd); FPDEvent := deExitProcess; end; break;