@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2022 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -46,11 +46,13 @@ #import "OFInitializationFailedException.h" #import "OFInvalidArgumentException.h" #import "OFOutOfRangeException.h" #ifdef OF_AMIGAOS +# define Class IntuitionClass # include +# undef Class #endif @implementation OFKernelEventObserver @synthesize delegate = _delegate; #ifdef OF_AMIGAOS @@ -204,15 +206,20 @@ { void *pool = objc_autoreleasePoolPush(); bool foundInReadBuffer = false; for (id object in [[_readObjects copy] autorelease]) { - void *pool2 = objc_autoreleasePoolPush(); + void *pool2; + + if (![object isKindOfClass: [OFStream class]]) + continue; + + pool2 = objc_autoreleasePoolPush(); - if ([object isKindOfClass: [OFStream class]] && - [object hasDataInReadBuffer] && - ![(OFStream *)object of_isWaitingForDelimiter]) { + if ([object hasDataInReadBuffer] && + (![object of_isWaitingForDelimiter] || + [object lowlevelHasDataInReadBuffer])) { if ([_delegate respondsToSelector: @selector(objectIsReadyForReading:)]) [_delegate objectIsReadyForReading: object]; foundInReadBuffer = true;