mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-08 09:38:12 +02:00
OpkMan: Increase TThreadTimer delay as workaround to prevent memory leaks. The other changes did not affect leaks.
git-svn-id: trunk@59381 -
This commit is contained in:
parent
b5d3a2e2ab
commit
e5df044216
@ -343,7 +343,8 @@ begin
|
||||
end;
|
||||
if Assigned(FTimer) and FTimer.Enabled then
|
||||
FTimer.StopTimer;
|
||||
Synchronize(@DoOnJSONDownloadCompleted);
|
||||
if not FNeedToBreak then
|
||||
Synchronize(@DoOnJSONDownloadCompleted);
|
||||
end
|
||||
else if FDownloadType = dtPackage then //download from repository
|
||||
begin
|
||||
@ -505,6 +506,7 @@ begin
|
||||
if FTimer.Enabled then
|
||||
FTimer.StopTimer;
|
||||
FTimer.Terminate;
|
||||
FTimer.WaitFor;
|
||||
end;
|
||||
FHTTPClient.Free;
|
||||
FMS.Free;
|
||||
@ -517,7 +519,7 @@ begin
|
||||
FRemoteJSONFile := Options.RemoteRepository[Options.ActiveRepositoryIndex] + cRemoteJSONFile;
|
||||
FDownloadType := dtJSON;
|
||||
FSilent := ASilent;
|
||||
if (Assigned(LazarusIDE) and LazarusIDE.IDEStarted and (not LazarusIDE.IDEIsClosing)) then
|
||||
if Assigned(LazarusIDE) and LazarusIDE.IDEStarted and not LazarusIDE.IDEIsClosing then
|
||||
begin
|
||||
FTimer := TThreadTimer.Create;
|
||||
FTimer.Interval := ATimeOut;
|
||||
@ -543,7 +545,7 @@ begin
|
||||
FTotSize := FTotSize + SerializablePackages.Items[I].RepositoryFileSize;
|
||||
end;
|
||||
end;
|
||||
if (Assigned(LazarusIDE) and LazarusIDE.IDEStarted and (not LazarusIDE.IDEIsClosing)) then
|
||||
if Assigned(LazarusIDE) and LazarusIDE.IDEStarted and not LazarusIDE.IDEIsClosing then
|
||||
begin
|
||||
FTimer := TThreadTimer.Create;
|
||||
FTimer.OnTimer := @DoOnTimer;
|
||||
|
@ -220,6 +220,7 @@ begin
|
||||
begin
|
||||
Updates.StopUpdate;
|
||||
Updates.Terminate;
|
||||
Updates.WaitFor;
|
||||
Updates := nil;
|
||||
end;
|
||||
end;
|
||||
|
@ -59,7 +59,7 @@ constructor TThreadTimer.Create;
|
||||
begin
|
||||
inherited Create(True);
|
||||
FreeOnTerminate := True;
|
||||
FInterval := 1000;
|
||||
FInterval := 10000;
|
||||
FEnabled := False;
|
||||
end;
|
||||
|
||||
@ -79,8 +79,8 @@ procedure TThreadTimer.Execute;
|
||||
begin
|
||||
while not Terminated do
|
||||
begin
|
||||
Sleep(100);
|
||||
if (GetTickCount64 - FTime > FInterval) and (FEnabled) then
|
||||
Sleep(1000);
|
||||
if (GetTickCount64 - FTime > FInterval) and FEnabled and not Terminated then
|
||||
begin
|
||||
FTime := GetTickCount64;
|
||||
DoOnTimer;
|
||||
|
Loading…
Reference in New Issue
Block a user