@@ -39,23 +39,16 @@ @implementation OFXMLElement (Serialization) - (id)objectByDeserializing { OFAutoreleasePool *pool; - OFString *className; Class class; id object; pool = [[OFAutoreleasePool alloc] init]; - className = [[self attributeForName: @"class"] stringValue]; - if (className == nil) - @throw [OFNotImplementedException - newWithClass: nil - selector: @selector(initWithSerialization:)]; - - class = objc_lookUpClass([className cString]); - if (class == Nil) + + if ((class = objc_lookUpClass([name cString])) == Nil) @throw [OFNotImplementedException newWithClass: Nil]; if (![class conformsToProtocol: @protocol(OFSerialization)]) @throw [OFNotImplementedException newWithClass: class @@ -63,13 +56,12 @@ object = [[class alloc] initWithSerialization: self]; @try { [pool release]; - } @catch (id e) { - [object release]; - @throw e; + } @finally { + [object autorelease]; } - return [object autorelease]; + return object; } @end