Converter: fix a memory leak when converting a single unit.

git-svn-id: trunk@39670 -
This commit is contained in:
juha 2012-12-28 00:14:52 +00:00
parent 15f0c7aa65
commit 289e83d1dd

View File

@ -866,8 +866,9 @@ var
begin begin
IDEMessagesWindow.Clear; IDEMessagesWindow.Clear;
DelphiUnit := TDelphiUnit.Create(Self, fOrigFilename, []); DelphiUnit := TDelphiUnit.Create(Self, fOrigFilename, []);
try
Result:=fSettings.RunForm(Nil); Result:=fSettings.RunForm(Nil);
if Result=mrOK then if Result=mrOK then begin
with DelphiUnit do with DelphiUnit do
try try
Result:=CopyAndLoadFile; Result:=CopyAndLoadFile;
@ -893,7 +894,11 @@ begin
end; end;
Result:=mrAbort; Result:=mrAbort;
end; end;
end;
ShowEndingMessage(Result); ShowEndingMessage(Result);
finally
DelphiUnit.Free;
end;
end; end;
{ TConvertDelphiProjPack } { TConvertDelphiProjPack }
@ -1311,7 +1316,6 @@ end;
destructor TConvertDelphiProject.Destroy; destructor TConvertDelphiProject.Destroy;
begin begin
if Assigned(fMainUnitConverter) then
fMainUnitConverter.Free; fMainUnitConverter.Free;
inherited Destroy; inherited Destroy;
end; end;