Differences From Artifact [a2958826ad]:
- File src/OFList.m — part of check-in [798d9e6320] at 2011-09-09 13:35:16 on branch trunk — [pool release] can never throw by convention now. (user: js, size: 9385) [annotate] [blame] [check-ins using]
To Artifact [c2b5c044cc]:
- File
src/OFList.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: 9427) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
43 44 45 46 47 48 49 | OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFAutoreleasePool *pool2; OFEnumerator *enumerator; OFXMLElement *child; if (![[element name] isEqual: [self className]] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) | | > | | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; OFAutoreleasePool *pool2; OFEnumerator *enumerator; OFXMLElement *child; if (![[element name] isEqual: [self className]] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException exceptionWithClass: isa selector: _cmd]; enumerator = [[element children] objectEnumerator]; pool2 = [[OFAutoreleasePool alloc] init]; while ((child = [enumerator nextObject]) != nil) { if (![[child namespace] isEqual: OF_SERIALIZATION_NS]) continue; |
︙ | ︙ | |||
439 440 441 442 443 444 445 | } - (id)nextObject { id ret; if (*mutationsPtr != mutations) | | > | | > > | 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 | } - (id)nextObject { id ret; if (*mutationsPtr != mutations) @throw [OFEnumerationMutationException exceptionWithClass: isa object: list]; if (current == NULL) return nil; ret = current->object; current = current->next; return ret; } - (void)reset { if (*mutationsPtr != mutations) @throw [OFEnumerationMutationException exceptionWithClass: isa object: list]; current = [list firstListObject]; } @end |