Fix for PurgeInputData when in a drain state, that could potentially cause a deadlock.

This commit is contained in:
mysticbbs 2013-01-24 11:49:10 -05:00
parent cee19d6898
commit 29ff598b3a
1 changed files with 4 additions and 1 deletions

View File

@ -64,12 +64,15 @@ Begin
FInBufEnd := 0; FInBufEnd := 0;
If Drain Then If Drain Then
While DataWaiting Do While DataWaiting Do Begin
ReadBuf(Buf, SizeOf(Buf)); ReadBuf(Buf, SizeOf(Buf));
If FInBufEnd <= 0 Then Break;
End;
End; End;
Function TIOBase.DataWaiting : Boolean; Function TIOBase.DataWaiting : Boolean;
Begin Begin
Result := False;
End; End;
Function TIOBase.WriteBuf (Var Buf; Len: LongInt) : LongInt; Function TIOBase.WriteBuf (Var Buf; Len: LongInt) : LongInt;