@@ -130,22 +130,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 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 @@ -186,14 +185,12 @@ objects = [_readObjects objects]; count = [_readObjects count]; for (size_t 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]]; @@ -202,18 +199,16 @@ objects = [_writeObjects objects]; count = [_writeObjects count]; for (size_t 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