The return value of `timeGetTime` is DWORD. So cast it as Integer might cause a
range check error.
Here is the patch:
procedure TTimerThread.Execute;
var
SleepTime: Integer;
Last: DWORD;
begin
while (FTimer.Continue) and (not Terminated) do
begin
Last := timeGetTime;
try
Synchronize(DoExecute);
except
// Just in case
end;
SleepTime := FTimer.FInterval - Integer(timeGetTime - Last);
if SleepTime < 10 then
SleepTime := 10;
Sleep(SleepTime);
end;
end;
Original issue reported on code.google.com by sx.a...@googlemail.com on 7 Apr 2014 at 4:47
Original issue reported on code.google.com by
sx.a...@googlemail.com
on 7 Apr 2014 at 4:47