Differences From Artifact [d0c40db2e0]:
- File src/OFStreamObserver_select.m — part of check-in [7da45d5ccf] at 2011-10-22 16:57:50 on branch trunk — Indentation fix. (user: js, size: 3241) [annotate] [blame] [check-ins using]
To Artifact [85d5b1242b]:
- File
src/OFStreamObserver_select.m
— part of check-in
[95fdb174f6]
at
2011-10-25 00:02:22
on branch trunk
— Always release the pool in -[OFStreamObserver observe].
Per convention, this would not be necessasry. However, a common
use case is to call -[observe] in a loop that never ends, thus
no pool below the one created in -[observe] will ever be released. (user: js, size: 3287) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
76 77 78 79 80 81 82 | fd_set writeFDs_; fd_set exceptFDs_; struct timeval time; size_t i, count; [self _processQueue]; | | > > | > > | 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | fd_set writeFDs_; fd_set exceptFDs_; struct timeval time; size_t i, count; [self _processQueue]; if ([self _processCache]) { [pool release]; return YES; } #ifdef FD_COPY FD_COPY(&readFDs, &readFDs_); FD_COPY(&writeFDs, &writeFDs_); FD_COPY(&exceptFDs, &exceptFDs_); #else readFDs_ = readFDs; writeFDs_ = writeFDs; exceptFDs_ = exceptFDs; #endif time.tv_sec = timeout / 1000; time.tv_usec = (timeout % 1000) * 1000; if (select((int)maxFD + 1, &readFDs_, &writeFDs_, &exceptFDs_, (timeout != -1 ? &time : NULL)) < 1) { [pool release]; return NO; } if (FD_ISSET(cancelFD[0], &readFDs_)) { char buffer; #ifndef _WIN32 assert(read(cancelFD[0], &buffer, 1) > 0); #else assert(recvfrom(cancelFD[0], &buffer, 1, 0, NULL, NULL) > 0); |
︙ | ︙ |