@@ -128,22 +128,21 @@ FD_CLR(fd, &_writeFDs); } - (void)observeForTimeInterval: (of_time_interval_t)timeInterval { - void *pool = objc_autoreleasePoolPush(); id const *objects; fd_set readFDs; fd_set writeFDs; struct timeval timeout; int events; size_t i, count; [self OF_processQueue]; - [self OF_processReadBuffers]; - objc_autoreleasePoolPop(pool); + if ([self OF_processReadBuffers]) + return; #ifdef FD_COPY FD_COPY(&_readFDs, &readFDs); FD_COPY(&_writeFDs, &writeFDs); #else @@ -184,14 +183,12 @@ objects = [_readObjects objects]; count = [_readObjects count]; for (i = 0; i < count; i++) { - int fd; - - pool = objc_autoreleasePoolPush(); - fd = [objects[i] fileDescriptorForReading]; + void *pool = objc_autoreleasePoolPush(); + int fd = [objects[i] fileDescriptorForReading]; if (FD_ISSET(fd, &readFDs) && [_delegate respondsToSelector: @selector(objectIsReadyForReading:)]) [_delegate objectIsReadyForReading: objects[i]]; @@ -200,18 +197,16 @@ objects = [_writeObjects objects]; count = [_writeObjects count]; for (i = 0; i < count; i++) { - int fd; - - pool = objc_autoreleasePoolPush(); - fd = [objects[i] fileDescriptorForWriting]; + void *pool = objc_autoreleasePoolPush(); + int fd = [objects[i] fileDescriptorForWriting]; if (FD_ISSET(fd, &writeFDs) && [_delegate respondsToSelector: @selector(objectIsReadyForWriting:)]) [_delegate objectIsReadyForWriting: objects[i]]; objc_autoreleasePoolPop(pool); } } @end