Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -209,11 +209,11 @@ return new; } - (id)objectAtIndex: (size_t)index { - return [[*((OFObject**)[array itemAtIndex: index]) retain] autorelease]; + return *((OFObject**)[array itemAtIndex: index]); } - (size_t)indexOfObject: (OFObject*)obj { id *objs = [array cArray]; @@ -246,18 +246,18 @@ - (id)firstObject { id *first = [array firstItem]; - return (first != NULL ? [[*first retain] autorelease] : nil); + return (first != NULL ? *first : nil); } - (id)lastObject { id *last = [array lastItem]; - return (last != NULL ? [[*last retain] autorelease] : nil); + return (last != NULL ? *last : nil); } - (OFString*)componentsJoinedByString: (OFString*)separator { OFString *str; Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -545,11 +545,11 @@ for (i = hash & (size - 1); i < last && data[i] != NULL; i++) { if (data[i] == DELETED) continue; if ([data[i]->key isEqual: key]) - return [[data[i]->object retain] autorelease]; + return data[i]->object; } if (i < last) return nil; @@ -559,11 +559,11 @@ for (i = 0; i < last && data[i] != NULL; i++) { if (data[i] == DELETED) continue; if ([data[i]->key isEqual: key]) - return [[data[i]->object retain] autorelease]; + return data[i]->object; } return nil; } Index: src/OFXMLParser.m ================================================================== --- src/OFXMLParser.m +++ src/OFXMLParser.m @@ -209,19 +209,20 @@ } if (buf[i] == '>' || buf[i] == '/') { OFString *ns; - pool = [[OFAutoreleasePool alloc] init]; ns = namespace_for_prefix(prefix, namespaces); if (prefix != nil && ns == nil) @throw [OFUnboundNamespaceException newWithClass: isa prefix: prefix]; + + pool = [[OFAutoreleasePool alloc] init]; [delegate parser: self didStartElement: name withPrefix: prefix namespace: ns @@ -295,26 +296,26 @@ newWithClass: isa]; [previous removeNObjects: 1]; [cache setToCString: ""]; - pool = [[OFAutoreleasePool alloc] init]; - ns = namespace_for_prefix(prefix, namespaces); if (prefix != nil && ns == nil) @throw [OFUnboundNamespaceException newWithClass: isa prefix: prefix]; - [namespaces removeNObjects: 1]; + + pool = [[OFAutoreleasePool alloc] init]; [delegate parser: self didEndElement: name withPrefix: prefix namespace: ns]; [pool release]; + [namespaces removeNObjects: 1]; [name release]; [prefix release]; name = prefix = nil; last = i + 1; @@ -327,17 +328,18 @@ /* Inside a tag, name found */ case OF_XMLPARSER_IN_TAG: if (buf[i] == '>' || buf[i] == '/') { OFString *ns; - pool = [[OFAutoreleasePool alloc] init]; ns = namespace_for_prefix(prefix, namespaces); if (prefix != nil && ns == nil) @throw [OFUnboundNamespaceException newWithClass: isa prefix: prefix]; + + pool = [[OFAutoreleasePool alloc] init]; [delegate parser: self didStartElement: name withPrefix: prefix namespace: ns