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