@@ -17,14 +17,14 @@ #include "config.h" #include #import "OFString.h" -#import "OFAutoreleasePool.h" #import "OFInvalidEncodingException.h" +#import "autorelease.h" #import "macros.h" int _OFString_XMLUnescaping_reference; static OF_INLINE OFString* @@ -129,28 +129,28 @@ else if (entityLength == 3 && !memcmp(entity, "amp", 3)) [ret appendCString: "&" withEncoding: OF_STRING_ENCODING_ASCII length: 1]; else if (entity[0] == '#') { - OFAutoreleasePool *pool; + void *pool; OFString *tmp; - pool = [[OFAutoreleasePool alloc] init]; + pool = objc_autoreleasePoolPush(); tmp = parse_numeric_entity(entity, entityLength); if (tmp == nil) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; [ret appendString: tmp]; - [pool release]; + objc_autoreleasePoolPop(pool); } else if (delegate != nil) { - OFAutoreleasePool *pool; + void *pool; OFString *n, *tmp; - pool = [[OFAutoreleasePool alloc] init]; + pool = objc_autoreleasePoolPush(); n = [OFString stringWithUTF8String: entity length: entityLength]; tmp = [delegate string: self @@ -159,11 +159,11 @@ if (tmp == nil) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; [ret appendString: tmp]; - [pool release]; + objc_autoreleasePoolPop(pool); } else @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; last = i + 1; @@ -232,28 +232,28 @@ else if (entityLength == 3 && !memcmp(entity, "amp", 3)) [ret appendCString: "&" withEncoding: OF_STRING_ENCODING_ASCII length: 1]; else if (entity[0] == '#') { - OFAutoreleasePool *pool; + void *pool; OFString *tmp; - pool = [[OFAutoreleasePool alloc] init]; + pool = objc_autoreleasePoolPush(); tmp = parse_numeric_entity(entity, entityLength); if (tmp == nil) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; [ret appendString: tmp]; - [pool release]; + objc_autoreleasePoolPop(pool); } else { - OFAutoreleasePool *pool; + void *pool; OFString *entityString, *tmp; - pool = [[OFAutoreleasePool alloc] init]; + pool = objc_autoreleasePoolPush(); entityString = [OFString stringWithUTF8String: entity length: entityLength]; tmp = block(self, entityString); @@ -261,11 +261,11 @@ if (tmp == nil) @throw [OFInvalidEncodingException exceptionWithClass: [self class]]; [ret appendString: tmp]; - [pool release]; + objc_autoreleasePoolPop(pool); } last = i + 1; inEntity = NO; }