ObjFW  Check-in [3e2b0e7eac]

Overview
Comment:Cache the class for exeptions in -[OFXMLElement initWithXMLString:].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 0.5
Files: files | file ages | folders
SHA3-256: 3e2b0e7eac66b6f5fec713bc7d8536e2ce486e84a8c70878238db541554f6403
User & Date: js on 2011-04-25 22:46:58
Other Links: branch diff | manifest | tags
Context
2011-04-27
21:29
Fix a typo in -[description] of OFConnectionFailedException. check-in: 560fbbd0b8 user: js tags: 0.5
2011-04-25
22:46
Cache the class for exeptions in -[OFXMLElement initWithXMLString:]. check-in: 3e2b0e7eac user: js tags: 0.5
22:39
Fix missing release in OFXMLElement. check-in: d948114b2a user: js tags: 0.5
Changes

Modified src/OFXMLElement.m from [76eb4c0e35] to [7d828168bf].

210
211
212
213
214
215
216

217

218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240

- initWithXMLString: (OFString*)str
{
	OFAutoreleasePool *pool;
	OFXMLParser *parser;
	OFXMLElementBuilder *builder;
	OFXMLElement_OFXMLElementBuilderDelegate *delegate;



	[self release];

	pool = [[OFAutoreleasePool alloc] init];

	parser = [OFXMLParser parser];
	builder = [OFXMLElementBuilder elementBuilder];
	delegate = [[[OFXMLElement_OFXMLElementBuilderDelegate alloc] init]
	    autorelease];

	[parser setDelegate: builder];
	[builder setDelegate: delegate];

	[parser parseString: str];

	if (![parser finishedParsing])
		@throw [OFMalformedXMLException newWithClass: isa
						      parser: parser];

	self = [delegate->element retain];

	@try {
		[pool release];
	} @catch (id e) {







>

>















|







210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242

- initWithXMLString: (OFString*)str
{
	OFAutoreleasePool *pool;
	OFXMLParser *parser;
	OFXMLElementBuilder *builder;
	OFXMLElement_OFXMLElementBuilderDelegate *delegate;
	Class c;

	c = isa;
	[self release];

	pool = [[OFAutoreleasePool alloc] init];

	parser = [OFXMLParser parser];
	builder = [OFXMLElementBuilder elementBuilder];
	delegate = [[[OFXMLElement_OFXMLElementBuilderDelegate alloc] init]
	    autorelease];

	[parser setDelegate: builder];
	[builder setDelegate: delegate];

	[parser parseString: str];

	if (![parser finishedParsing])
		@throw [OFMalformedXMLException newWithClass: c
						      parser: parser];

	self = [delegate->element retain];

	@try {
		[pool release];
	} @catch (id e) {