Use TFPList.FreeAndNilDisposing in four more places.

This commit is contained in:
Rika Ichinose 2024-10-27 21:37:00 +03:00 committed by FPK
parent 183a10b292
commit bff561063f
2 changed files with 4 additions and 25 deletions

View File

@ -1103,14 +1103,10 @@ implementation
class procedure tnodeutils.release_init_final_list(list:tfplist);
var
i : longint;
begin
if not assigned(list) then
internalerror(2017051901);
for i:=0 to list.count-1 do
dispose(pinitfinalentry(list[i]));
list.free;
TFPList.FreeAndNilDisposing(list,typeinfo(tinitfinalentry));
end;

View File

@ -1974,12 +1974,8 @@ implementation
destructor tgenericconstraintdata.destroy;
var
i : longint;
begin
for i:=0 to interfacesderef.count-1 do
dispose(pderef(interfacesderef[i]));
interfacesderef.free;
TFPList.FreeAndNilDisposing(interfacesderef,typeinfo(tderef));
interfaces.free;
inherited destroy;
end;
@ -2103,8 +2099,6 @@ implementation
destructor tstoreddef.destroy;
var
i : longint;
begin
{ Direct calls are not allowed, use symtable.deletedef() }
if assigned(owner) then
@ -2116,10 +2110,7 @@ implementation
end;
rtti_attribute_list.free;
genericparas.free;
if assigned(genericparaderefs) then
for i:=0 to genericparaderefs.count-1 do
dispose(pderef(genericparaderefs[i]));
genericparaderefs.free;
TFPList.FreeAndNilDisposing(genericparaderefs,typeinfo(tderef));
genconstraintdata.free;
{$ifndef symansistr}
stringdispose(_fullownerhierarchyname);
@ -6797,19 +6788,11 @@ implementation
procedure tprocdef.freeimplprocdefinfo;
var
i : longint;
begin
if assigned(implprocdefinfo) then
begin
stringdispose(implprocdefinfo^.resultname);
if assigned(implprocdefinfo^.capturedsyms) then
begin
for i:=0 to implprocdefinfo^.capturedsyms.count-1 do
dispose(pcapturedsyminfo(implprocdefinfo^.capturedsyms[i]));
end;
implprocdefinfo^.capturedsyms.free;
implprocdefinfo^.capturedsyms:=nil;
TFPList.FreeAndNilDisposing(implprocdefinfo^.capturedsyms,typeinfo(tcapturedsyminfo));
freemem(implprocdefinfo);
implprocdefinfo:=nil;
end;