mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-27 00:22:01 +02:00
Converter: Do not free CacheUnitsThread automatically on terminate. Fixes a memory leak when conversion is aborted.
git-svn-id: trunk@53894 -
This commit is contained in:
parent
662bc7f0d2
commit
5f92759f52
@ -1033,6 +1033,7 @@ begin
|
||||
Result:=mrAbort;
|
||||
end;
|
||||
finally
|
||||
CacheUnitsThread.Free;
|
||||
EndTime:=Now;
|
||||
s:=FormatDateTime('hh:nn:ss', EndTime-StartTime);
|
||||
if (Result<>mrAbort) and (s<>'00:00:00') then
|
||||
|
@ -212,7 +212,6 @@ type
|
||||
public
|
||||
constructor Create(AOwner: TComponent; ASettings: TConvertSettings); reintroduce;
|
||||
destructor Destroy; override;
|
||||
property CacheUnitsThread: TThread read fCacheUnitsThread;
|
||||
end;
|
||||
|
||||
|
||||
@ -853,8 +852,6 @@ end;
|
||||
|
||||
destructor TConvertSettingsForm.Destroy;
|
||||
begin
|
||||
if Assigned(fCacheUnitsThread) and not fThreadStarted then
|
||||
fCacheUnitsThread.Free;
|
||||
inherited Destroy;
|
||||
end;
|
||||
|
||||
@ -966,7 +963,6 @@ begin
|
||||
if ScanParentDirCheckBox.Checked and Assigned(fCacheUnitsThread) then
|
||||
begin
|
||||
ThreadGuiShow(True);
|
||||
fCacheUnitsThread.FreeOnTerminate:=True;
|
||||
fCacheUnitsThread.OnTerminate:=@ThreadTerminated;
|
||||
fCacheUnitsThread.Start;
|
||||
fThreadStarted := True;
|
||||
@ -1002,7 +998,6 @@ end;
|
||||
procedure TConvertSettingsForm.ThreadTerminated(Sender: TObject);
|
||||
begin
|
||||
ThreadGuiShow(False);
|
||||
fCacheUnitsThread := nil; // Thread frees itself. Make the variable nil, too.
|
||||
end;
|
||||
|
||||
// Edit replacements in grids
|
||||
|
Loading…
Reference in New Issue
Block a user