mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 12:09:21 +02:00
improved freeing TSynCompletion from Burkhard Carstens
git-svn-id: trunk@9425 -
This commit is contained in:
parent
3e00d7d57f
commit
a7f0807084
@ -1324,8 +1324,9 @@ procedure TSynCompletion.Notification(AComponent: TComponent;
|
|||||||
Operation: TOperation);
|
Operation: TOperation);
|
||||||
begin
|
begin
|
||||||
inherited Notification(AComponent, Operation);
|
inherited Notification(AComponent, Operation);
|
||||||
if (Operation = opRemove) and (fEditors.IndexOf(AComponent) > -1) then
|
if (Operation = opRemove) and (fEditors <> nil) then
|
||||||
RemoveEditor(AComponent as TCustomSynEdit);
|
if (fEditors.IndexOf(AComponent) > -1) then
|
||||||
|
RemoveEditor(AComponent as TCustomSynEdit);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TSynCompletion.Create(AOwner: TComponent);
|
constructor TSynCompletion.Create(AOwner: TComponent);
|
||||||
@ -1436,8 +1437,8 @@ begin
|
|||||||
Form := nil;
|
Form := nil;
|
||||||
while fEditors.Count <> 0 do
|
while fEditors.Count <> 0 do
|
||||||
RemoveEditor(TCustomSynEdit(fEditors.last));
|
RemoveEditor(TCustomSynEdit(fEditors.last));
|
||||||
fEditors.Free;
|
FreeAndNil(fEditors);
|
||||||
fEditstuffs.free;
|
FreeAndNil(fEditstuffs);
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1545,9 +1546,9 @@ begin
|
|||||||
{$ELSE}
|
{$ELSE}
|
||||||
RemoveEditor(feditors.last);
|
RemoveEditor(feditors.last);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
fEditors.free;
|
FreeAndNil(fEditors);
|
||||||
fEditstuffs.free;
|
FreeAndNil(fEditstuffs);
|
||||||
fAutoCompleteList.free;
|
FreeAndNil(fAutoCompleteList);
|
||||||
inherited;
|
inherited;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1676,8 +1677,9 @@ end;
|
|||||||
procedure TSynAutoComplete.Notification(AComponent: TComponent; Operation: TOperation);
|
procedure TSynAutoComplete.Notification(AComponent: TComponent; Operation: TOperation);
|
||||||
begin
|
begin
|
||||||
inherited Notification(AComponent, Operation);
|
inherited Notification(AComponent, Operation);
|
||||||
if (Operation = opRemove) and (fEditors.indexOf(AComponent) <> -1) then
|
if (Operation = opRemove) and (fEditors <> nil) then
|
||||||
RemoveEditor(AComponent as TCustomSynEdit);
|
if fEditors.indexOf(AComponent) <> -1 then
|
||||||
|
RemoveEditor(AComponent as TCustomSynEdit);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TSynAutoComplete.RemoveEditor(aEditor: TCustomSynEdit): boolean;
|
function TSynAutoComplete.RemoveEditor(aEditor: TCustomSynEdit): boolean;
|
||||||
|
Loading…
Reference in New Issue
Block a user