2011-11-1 21:27
hsgrass
TCnTimerMgr EIntOverflow
Call Stack Information:
------------------------------------------------------------------------------------
|Address |Module |Unit |Class |Procedure/Method |Line |
------------------------------------------------------------------------------------
|+Memory Leak: Type=EIntOverflow; Total size=16; Count=1 |
|----------------------------------------------------------------------------------|
|00411B7A|VMControler.exe|sysutils.pas | |ErrorHandler |13414[9]|
|00402D5A|VMControler.exe|system.pas | |ErrorAt |3016[3] |
|005C71C9|VMControler.exe|CnTimer.pas |TCnTimerMgr |WndProc |438[3] |
|00430354|VMControler.exe|classes.pas | |StdWndProc |10966[8]|
|76C23573|user32.dll | | |DispatchMessageA | |
|004DF754|VMControler.exe|Forms.pas |TApplication|ProcessMessage |6873[13]|
|004DF79B|VMControler.exe|Forms.pas |TApplication|HandleMessage |6892[1] |
|004DFA36|VMControler.exe|Forms.pas |TApplication|Run |6976[16]|
procedure TCnTimerMgr.DoTimer(Sync: Boolean);
var
i: Integer;
CurrTick: Int64; // 这个原来是cardinal,改为int64即可
begin
with FTimerList.LockList do
try
CurrTick := timeGetTime;
for i := 0 to Count - 1 do
with TCnTimerObject(Items[i]) do
if Enabled and (FSyncEvent = Sync) and(Interval <> 0) and
(CurrTick - FLastTickCount >= Interval) and Assigned(FOnTimer) then // 在这里升起EIntOverflow异常
begin
if CurrTick <> FLastTickCount then
FActualFPS := 1000 / (CurrTick - FLastTickCount)
else
FActualFPS := 0;
FLastTickCount := CurrTick;
try
Timer;
except
Application.HandleException(Self);
end;
end;
finally
FTimerList.UnlockList;
end;
end;