From 9f333fb56ddaa3cf0c30d00057f929aaa69b82ae Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Mon, 7 Nov 2011 14:10:23 +0200 Subject: Timer related functions now check to see if global fpgTimers exists or not. --- src/corelib/fpg_main.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/fpg_main.pas b/src/corelib/fpg_main.pas index e1acf0eb..395aad5c 100644 --- a/src/corelib/fpg_main.pas +++ b/src/corelib/fpg_main.pas @@ -542,6 +542,8 @@ var i: integer; ctime: TDateTime; begin + if fpgTimers = nil then + Exit; ctime := now; i := fpgTimers.Count; Result := i > 0; @@ -559,6 +561,8 @@ procedure fpgResetAllTimers; var i: integer; begin + if fpgTimers = nil then + Exit; for i := 0 to fpgTimers.Count-1 do TfpgTimer(fpgTimers[i]).Reset; end; @@ -570,6 +574,8 @@ var dt: TDateTime; tb: Boolean; begin + if fpgTimers = nil then + Exit; // returns -1 if no timers are pending dt := ctime + amaxtime * ONE_MILISEC; tb := False; @@ -867,7 +873,7 @@ begin // Dump_Stack(StdOut, get_frame); Writeln(stdout,'An unhandled exception occurred at $',HexStr(Ptrint(ExceptAddr),sizeof(PtrInt)*2),' :'); - if ExceptObject is exception then + if ExceptObject is Exception then begin lMessage := Exception(ExceptObject).ClassName+' : '+Exception(ExceptObject).Message; Writeln(stdout,lMessage); -- cgit v1.2.3-70-g09d2