mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-22 00:28:35 +02:00
LazDebuggerFpLLDB: Fix potential dangling pointer in Locals eval.
git-svn-id: trunk@59802 -
This commit is contained in:
parent
5c4bd12dd3
commit
9de85d233b
@ -189,6 +189,7 @@ type
|
||||
private
|
||||
FOwner: TFPLldbLocals;
|
||||
FLocals: TLocals;
|
||||
procedure DoLocalsFreed(Sender: TObject);
|
||||
protected
|
||||
procedure DoExecute; override;
|
||||
public
|
||||
@ -260,9 +261,17 @@ type
|
||||
|
||||
{ TFpLldbDebuggerCommandLocals }
|
||||
|
||||
procedure TFpLldbDebuggerCommandLocals.DoLocalsFreed(Sender: TObject);
|
||||
begin
|
||||
FLocals := nil;
|
||||
end;
|
||||
|
||||
procedure TFpLldbDebuggerCommandLocals.DoExecute;
|
||||
begin
|
||||
if FLocals <> nil then begin
|
||||
FOwner.ProcessLocals(FLocals);
|
||||
FLocals.RemoveFreeNotification(@DoLocalsFreed);
|
||||
end;
|
||||
Finished;
|
||||
end;
|
||||
|
||||
@ -271,6 +280,7 @@ begin
|
||||
inherited Create(AOwner.FpDebugger);
|
||||
FOwner := AOwner;
|
||||
FLocals := ALocals;
|
||||
FLocals.AddFreeNotification(@DoLocalsFreed);
|
||||
////// Priority := 1; // before watches
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user