From 931084900e3dc068138284b866fb5f2b360952eb Mon Sep 17 00:00:00 2001 From: Niels Date: Mon, 4 Oct 2010 17:06:22 +0200 Subject: [PATCH 1/2] Added little safety check. Seems to fix bug#272, can someone confirm this? --- Units/MMLAddon/mmlpsthread.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Units/MMLAddon/mmlpsthread.pas b/Units/MMLAddon/mmlpsthread.pas index cec8dcf..d8dfc7d 100644 --- a/Units/MMLAddon/mmlpsthread.pas +++ b/Units/MMLAddon/mmlpsthread.pas @@ -278,9 +278,9 @@ uses {Some General PS Functions here} procedure psWriteln(str : string); extdecl; begin - if CurrThread.Prop.WriteTimeStamp then + if Assigned(CurrThread) and CurrThread.Prop.WriteTimeStamp then str := format('[%s]: %s', [TimeToStr(TimeStampToDateTime(MSecsToTimeStamp(GetTickCount - CurrThread.StartTime))), str]); - if Assigned(CurrThread.DebugTo) then + if Assigned(CurrThread) and Assigned(CurrThread.DebugTo) then CurrThread.DebugTo(str) else mDebugLn(str); From a7d6cd748b755c86dafa31ac3df7904d5e643ba5 Mon Sep 17 00:00:00 2001 From: Niels Date: Mon, 4 Oct 2010 17:10:05 +0200 Subject: [PATCH 2/2] Added another safety check for the heck of it. --- Units/MMLAddon/mmlpsthread.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Units/MMLAddon/mmlpsthread.pas b/Units/MMLAddon/mmlpsthread.pas index d8dfc7d..8b32a7c 100644 --- a/Units/MMLAddon/mmlpsthread.pas +++ b/Units/MMLAddon/mmlpsthread.pas @@ -288,7 +288,7 @@ end; procedure ps_DebugLn(str : string); extdecl; begin - if CurrThread.Prop.WriteTimeStamp then + if Assigned(CurrThread) and CurrThread.Prop.WriteTimeStamp then str := format('[%s]: %s', [TimeToStr(TimeStampToDateTime(MSecsToTimeStamp(GetTickCount - CurrThread.StartTime))), str]); mDebugLn(str); end;