Differences From Artifact [032c6d7a87]:
- File
src/OFStreamObserver_poll.m
— part of check-in
[e1e7ffa903]
at
2011-09-22 23:25:42
on branch trunk
— Exceptions are now autoreleased.
This is safe as an "exception loop" can't happen, since if allocating
an exception fails, it throws an OFAllocFailedException which is
preallocated and can always be thrown.So, the worst case would be that an autorelease of an exception fails,
triggering an OFOutOfMemoryException for which there is no memory,
resulting in an OFAllocFailedException to be thrown. (user: js, size: 3432) [annotate] [blame] [check-ins using]
To Artifact [c610bddecc]:
- File
src/OFStreamObserver_poll.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: 3478) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
123 124 125 126 127 128 129 | { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; struct pollfd *FDsCArray; size_t i, nFDs; [self _processQueue]; | | > > | > > | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | { OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; struct pollfd *FDsCArray; size_t i, nFDs; [self _processQueue]; if ([self _processCache]) { [pool release]; return YES; } FDsCArray = [FDs cArray]; nFDs = [FDs count]; #ifdef OPEN_MAX if (nFDs > OPEN_MAX) @throw [OFOutOfRangeException exceptionWithClass: isa]; #endif if (poll(FDsCArray, (nfds_t)nFDs, timeout) < 1) { [pool release]; return NO; } for (i = 0; i < nFDs; i++) { if (FDsCArray[i].revents & POLLIN) { if (FDsCArray[i].fd == cancelFD[0]) { char buffer; assert(read(cancelFD[0], &buffer, 1) > 0); |
︙ | ︙ |