mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-20 09:08:53 +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
|
private
|
||||||
FOwner: TFPLldbLocals;
|
FOwner: TFPLldbLocals;
|
||||||
FLocals: TLocals;
|
FLocals: TLocals;
|
||||||
|
procedure DoLocalsFreed(Sender: TObject);
|
||||||
protected
|
protected
|
||||||
procedure DoExecute; override;
|
procedure DoExecute; override;
|
||||||
public
|
public
|
||||||
@ -260,9 +261,17 @@ type
|
|||||||
|
|
||||||
{ TFpLldbDebuggerCommandLocals }
|
{ TFpLldbDebuggerCommandLocals }
|
||||||
|
|
||||||
|
procedure TFpLldbDebuggerCommandLocals.DoLocalsFreed(Sender: TObject);
|
||||||
|
begin
|
||||||
|
FLocals := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TFpLldbDebuggerCommandLocals.DoExecute;
|
procedure TFpLldbDebuggerCommandLocals.DoExecute;
|
||||||
begin
|
begin
|
||||||
FOwner.ProcessLocals(FLocals);
|
if FLocals <> nil then begin
|
||||||
|
FOwner.ProcessLocals(FLocals);
|
||||||
|
FLocals.RemoveFreeNotification(@DoLocalsFreed);
|
||||||
|
end;
|
||||||
Finished;
|
Finished;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -271,6 +280,7 @@ begin
|
|||||||
inherited Create(AOwner.FpDebugger);
|
inherited Create(AOwner.FpDebugger);
|
||||||
FOwner := AOwner;
|
FOwner := AOwner;
|
||||||
FLocals := ALocals;
|
FLocals := ALocals;
|
||||||
|
FLocals.AddFreeNotification(@DoLocalsFreed);
|
||||||
////// Priority := 1; // before watches
|
////// Priority := 1; // before watches
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user