mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:59:20 +02:00
fixed memleak on exception
git-svn-id: trunk@9714 -
This commit is contained in:
parent
f863fe8262
commit
d6550769d0
@ -6470,6 +6470,7 @@ var ExprType: TExpressionType;
|
||||
ExprStartPos, ExprEndPos: integer;
|
||||
CurIgnoreErrorAfterPos: Integer;
|
||||
OldFlags: TFindDeclarationFlags;
|
||||
ok: Boolean;
|
||||
|
||||
procedure RaiseBracketNotFound;
|
||||
begin
|
||||
@ -6482,6 +6483,8 @@ begin
|
||||
'"',copy(Src,StartPos,40),'" Context=',Params.ContextNode.DescAsString);
|
||||
{$ENDIF}
|
||||
Result:=TExprTypeList.Create;
|
||||
ok:=false;
|
||||
try
|
||||
MoveCursorToCleanPos(StartPos);
|
||||
ReadNextAtom; // reads first atom after proc name
|
||||
if AtomIsChar('(') then
|
||||
@ -6536,6 +6539,10 @@ begin
|
||||
'ParamCount=',dbgs(Result.Count),' "',copy(Src,StartPos,40),'"');
|
||||
DebugLn(' ExprList=[',Result.AsString,']');
|
||||
{$ENDIF}
|
||||
Ok:=true;
|
||||
finally
|
||||
if not Ok then Result.Free;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TFindDeclarationTool.CreateParamExprListFromProcNode(
|
||||
|
Loading…
Reference in New Issue
Block a user