Delphi-converter: Fixed mem leaks

git-svn-id: trunk@25084 -
This commit is contained in:
martin 2010-04-30 23:49:25 +00:00
parent 008ae9167f
commit 720381e689

View File

@ -825,6 +825,7 @@ begin
fAllMissingUnits.Free;
fCachedRealUnitNames.Free;
fCachedUnitNames.Free;
FreeAndNil(fSettings);
inherited Destroy;
end;
@ -1143,17 +1144,21 @@ var
PasFile, RelPath, SubPath, sUnitName: String;
begin
PasFileList:=FindAllFiles(APath,'*.pas',true);
for i:=0 to PasFileList.Count-1 do begin
PasFile:=PasFileList[i];
RelPath:=FileUtil.CreateRelativePath(PasFile, ABasePath);
SubPath:=ExtractFilePath(RelPath);
sUnitName:=ExtractFileNameOnly(RelPath);
if (SubPath<>'') and (sUnitName<>'') then begin
// Map path by unit name.
fCachedUnitNames[sUnitName]:=SubPath;
// Map real unit name by uppercase unit name.
fCachedRealUnitNames[UpperCase(sUnitName)]:=sUnitName;
try
for i:=0 to PasFileList.Count-1 do begin
PasFile:=PasFileList[i];
RelPath:=FileUtil.CreateRelativePath(PasFile, ABasePath);
SubPath:=ExtractFilePath(RelPath);
sUnitName:=ExtractFileNameOnly(RelPath);
if (SubPath<>'') and (sUnitName<>'') then begin
// Map path by unit name.
fCachedUnitNames[sUnitName]:=SubPath;
// Map real unit name by uppercase unit name.
fCachedRealUnitNames[UpperCase(sUnitName)]:=sUnitName;
end;
end;
finally
PasFileList.Free;
end;
end;