* fixed memory leaks in compiler.

git-svn-id: trunk@5369 -
This commit is contained in:
yury 2006-11-14 09:32:58 +00:00
parent ba53db3b5d
commit d8d25c2489
7 changed files with 25 additions and 8 deletions

View File

@ -316,6 +316,7 @@ implementation
{$endif}
for hal:=low(TAsmListType) to high(TAsmListType) do
AsmLists[hal].free;
CurrAsmList.free;
{$ifdef MEMDEBUG}
memasmlists.stop;
{$endif}

View File

@ -200,7 +200,7 @@ implementation
constructor TDirectoryCache.create;
begin
inherited create;
FDirectories:=TFPHashObjectList.Create(false);
FDirectories:=TFPHashObjectList.Create(true);
end;

View File

@ -1293,6 +1293,8 @@ implementation
unitsearchpath.Free;
objectsearchpath.Free;
includesearchpath.Free;
LinkLibraryAliases.Free;
LinkLibraryOrder.Free;
end;
procedure InitGlobals;

View File

@ -601,6 +601,7 @@ implementation
begin
if assigned(Data) then
Data.Free;
stringdispose(FCachedFullName);
ObjRelocations.Free;
ObjSymbolDefines.Free;
VTRefList.Free;
@ -1323,7 +1324,7 @@ implementation
constructor TImportLibrary.create(AList:TFPHashObjectList;const AName:string);
begin
inherited create(AList,AName);
FImportSymbolList:=TFPHashObjectList.Create(false);
FImportSymbolList:=TFPHashObjectList.Create(true);
end;
@ -1538,6 +1539,7 @@ implementation
objsec:=TObjSection(TmpObjSectionList[i]);
CurrExeSec.AddObjSection(objsec);
end;
TmpObjSectionList.Free;
end;

View File

@ -181,8 +181,6 @@ unit opttail;
oldnodes : tnode;
i : longint;
begin
labelnode:=clabelnode.create(cnothingnode.create);
{ check if the parameters actually would support tail recursion elimination }
for i:=0 to p.paras.count-1 do
with tparavarsym(p.paras[i]) do
@ -190,6 +188,8 @@ unit opttail;
((varspez=vs_const) and
(paramanager.push_addr_param(varspez,vardef,p.proccalloption))) then
exit;
labelnode:=clabelnode.create(cnothingnode.create);
if find_and_replace_tailcalls(n) then
begin
oldnodes:=n;

View File

@ -2948,6 +2948,7 @@ implementation
dispose(inlininginfo);
inlininginfo:=nil;
end;
stringdispose(resultname);
stringdispose(import_dll);
stringdispose(import_name);
if (po_msgstr in procoptions) then

View File

@ -50,9 +50,12 @@ interface
end;
TExportLibWin=class(texportlib)
private
st : string;
EList_indexed:TFPList;
EList_nonindexed:TFPList;
public
destructor Destroy;override;
procedure preparelib(const s:string);override;
procedure exportprocedure(hp : texported_item);override;
procedure exportvar(hp : texported_item);override;
@ -572,6 +575,14 @@ implementation
TExportLibWin
*****************************************************************************}
destructor TExportLibWin.Destroy;
begin
EList_indexed.Free;
EList_nonindexed.Free;
inherited;
end;
procedure TExportLibWin.preparelib(const s:string);
begin
if current_asmdata.asmlists[al_exports]=nil then
@ -666,8 +677,8 @@ implementation
if Gl_DoubleIndex then
begin
message1(parser_e_export_ordinal_double,tostr(Gl_DoubleIndexValue));
EList_indexed.Free;
EList_nonindexed.Free;
FreeAndNil(EList_indexed);
FreeAndNil(EList_nonindexed);
exit;
end;
@ -694,10 +705,10 @@ implementation
EList_nonindexed.Delete(ni_high);
texported_item(EList_indexed.Items[pred(AutoIndex)]).index:=autoindex;
end;
EList_nonindexed.Free;
FreeAndNil(EList_nonindexed);
for i:=0 to pred(EList_indexed.Count)do
exportfromlist(texported_item(EList_indexed.Items[i]));
EList_indexed.Free;
FreeAndNil(EList_indexed);
if (target_asm.id in [as_i386_masm,as_i386_tasm,as_i386_nasmwin32]) then
begin