mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-19 15:19:16 +02:00
DBG: fixed a mem leak in array-index helper code
git-svn-id: trunk@33397 -
This commit is contained in:
parent
38e322bc0f
commit
9af87b923e
@ -1260,6 +1260,7 @@ var
|
||||
if aList.PartCount = 0 then exit;
|
||||
if (aList.PartCount = 1) and (Result = nil) then begin
|
||||
Result := aList.Parts[0];
|
||||
aList.ClearShared;
|
||||
exit;
|
||||
end;
|
||||
|
||||
@ -1274,6 +1275,7 @@ var
|
||||
end;
|
||||
|
||||
TGDBExpressionPartList(Result).AddList(aList);
|
||||
aList.ClearShared;
|
||||
end;
|
||||
|
||||
function MoveListToCopy(aList: TGDBExpressionPartList): TGDBExpressionPart;
|
||||
@ -1345,13 +1347,11 @@ begin
|
||||
ScanToWordStart;
|
||||
CurList.Add(TGDBExpression.CreateSimple(CurPartPtr, CurPtr - CurPartPtr));
|
||||
AddExpPart(CurList);
|
||||
CurList.ClearShared;
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
AddExpPart(CurList);
|
||||
CurList.ClearShared;
|
||||
CurList.Free;
|
||||
|
||||
if CurPtr < EndPtr then debugln(['Scan aborted: ', PCLenToString(FText)]);
|
||||
@ -1412,6 +1412,7 @@ end;
|
||||
|
||||
destructor TGDBExpressionPartListBase.Destroy;
|
||||
begin
|
||||
Clear;
|
||||
FreeAndNil(FList);
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user