From fbb65eaa20b8510b6c1d54f0a60046bbfac45120 Mon Sep 17 00:00:00 2001 From: Martin Date: Fri, 19 Jan 2024 15:41:24 +0100 Subject: [PATCH] FpDebug: Fix dangling pointer, if debug-backend sets breakpoint too late. (cherry picked from commit ec98b15709107cb90283afb5ccee90faae5d36fe) --- components/fpdebug/fpdbgclasses.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/fpdebug/fpdbgclasses.pp b/components/fpdebug/fpdbgclasses.pp index d38ce34c0c..22ce1a453a 100644 --- a/components/fpdebug/fpdbgclasses.pp +++ b/components/fpdebug/fpdbgclasses.pp @@ -2871,7 +2871,7 @@ end; procedure TDbgProcess.AfterBreakpointAdded(ABreak: TFpDbgBreakpoint); begin - if not assigned(FCurrentBreakpoint) then begin + if (FMainThread <> nil) and not assigned(FCurrentBreakpoint) then begin if ABreak.HasLocation(FMainThread.GetInstructionPointerRegisterValue) then FCurrentBreakpoint := TFpInternalBreakpoint(ABreak); end;