From 29ff598b3ac8f2bd21223e4a1074bdee400d6cd4 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Thu, 24 Jan 2013 11:49:10 -0500 Subject: [PATCH] Fix for PurgeInputData when in a drain state, that could potentially cause a deadlock. --- mdl/m_io_base.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mdl/m_io_base.pas b/mdl/m_io_base.pas index ff88255..5a26428 100644 --- a/mdl/m_io_base.pas +++ b/mdl/m_io_base.pas @@ -64,12 +64,15 @@ Begin FInBufEnd := 0; If Drain Then - While DataWaiting Do + While DataWaiting Do Begin ReadBuf(Buf, SizeOf(Buf)); + If FInBufEnd <= 0 Then Break; + End; End; Function TIOBase.DataWaiting : Boolean; Begin + Result := False; End; Function TIOBase.WriteBuf (Var Buf; Len: LongInt) : LongInt;