Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -114,34 +114,20 @@ - initWithText: (OFString*)text_ { self = [super init]; - @try { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; - text = [[text_ stringByXMLEscaping] retain]; - [pool release]; - } @catch (OFException *e) { - [self dealloc]; - @throw e; - } + text = [text_ copy]; return self; } - initWithComment: (OFString*)comment_ { self = [super init]; - @try { - comment = [[OFMutableString alloc] initWithString: @""]; - } @catch (OFException *e) { - [self dealloc]; - @throw e; - } + comment = [comment_ copy]; return self; } - (OFString*)_stringWithParentNamespaces: (OFDictionary*)parent_namespaces @@ -155,14 +141,21 @@ OFString *ret, *tmp; OFMutableDictionary *all_namespaces; OFString *def_ns; if (text != nil) - return [[text retain] autorelease]; + return [text stringByXMLEscaping]; + + if (comment != nil) { + OFMutableString *str; + + str = [OFMutableString stringWithString: @""]; - if (comment != nil) - return [[comment retain] autorelease]; + return str; + } pool = [[OFAutoreleasePool alloc] init]; def_ns = (defaultNamespace != nil ? defaultNamespace : parent_default_ns);