@@ -17,13 +17,14 @@ #include "config.h" #import "OFXMLCDATA.h" #import "OFString.h" #import "OFXMLElement.h" -#import "OFAutoreleasePool.h" #import "OFInvalidArgumentException.h" + +#import "autorelease.h" @implementation OFXMLCDATA + CDATAWithString: (OFString*)string { return [[[self alloc] initWithString: string] autorelease]; @@ -46,21 +47,21 @@ - initWithSerialization: (OFXMLElement*)element { self = [super init]; @try { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); if (![[element name] isEqual: [self className]] || ![[element namespace] isEqual: OF_SERIALIZATION_NS]) @throw [OFInvalidArgumentException exceptionWithClass: [self class] selector: _cmd]; CDATA = [[element stringValue] copy]; - [pool release]; + objc_autoreleasePoolPop(pool); } @catch (id e) { [self release]; @throw e; }