1
0
mirror of https://github.com/moparisthebest/Simba synced 2024-11-21 16:55:01 -05:00

Fixed another (possible) memory leak in param hints

This commit is contained in:
Niels 2010-05-24 00:17:21 +02:00
parent 21286973fd
commit 2d8389be3e
2 changed files with 11 additions and 7 deletions

View File

@ -426,7 +426,7 @@ begin
if (d <> nil) then
begin
d := TciTypeKind(d).GetRealType;
if (d is TciReturnType) then
if (d <> nil) and (d is TciReturnType) then
d := d.Owner;
end;
if (d <> nil) and (d.Owner <> nil) and (not ((d is TciProcedureDeclaration) or (d.Owner is TciProcedureDeclaration))) then

View File

@ -614,7 +614,7 @@ var
CursorXY : TPoint;
begin
result := -1;
if (FSynEdit = nil) or (FParameters = nil) then
if (FSynEdit = nil) then
Exit;
MustHide := True;
Parser := TmwPasLex.Create; //The position of the bracket
@ -812,10 +812,9 @@ end;
procedure TParamHint.ParamHintHide(Sender: TObject);
begin
if FMP <> nil then
freeandnil(Fmp);
if Fmp <> nil then
FreeAndNil(Fmp);
FDecl := nil;
FParameters:= nil;
FSynEdit := nil;
end;
@ -976,14 +975,19 @@ procedure TParamHint.Show(StartPoint,BracketPoint: TPoint;Decl : TciProcedureDec
begin
if self.Visible then
self.hide;
FDecl := Decl;
Fmp := mp;
FParameters:= Decl.GetParamDeclarations;
if Length(FParameters) = 0 then //Method has no Parameters
exit;
begin
FreeAndNil(Fmp);
Exit;
end;
FDecl := Decl;
FSynEdit := Editor;
FStartPoint:= StartPoint;
FBracketPoint:= BracketPoint;
CalculateBounds; //Calculate the size we need!
self.Visible := true;
end;