ObjFW  Diff

Differences From Artifact [d91bdef886]:

To Artifact [6eac9873fd]:

  • File src/OFNull.m — part of check-in [e1e7ffa903] at 2011-09-22 23:25:42 on branch trunk — Exceptions are now autoreleased.

    This is safe as an "exception loop" can't happen, since if allocating
    an exception fails, it throws an OFAllocFailedException which is
    preallocated and can always be thrown.

    So, the worst case would be that an autorelease of an exception fails,
    triggering an OFOutOfMemoryException for which there is no memory,
    resulting in an OFAllocFailedException to be thrown. (user: js, size: 1961) [annotate] [blame] [check-ins using]


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

	[self release];

	pool = [[OFAutoreleasePool alloc] init];

	if (![[element name] isEqual: [self className]] ||
	    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
		@throw [OFInvalidArgumentException newWithClass: isa
						       selector: _cmd];

	[pool release];

	return [OFNull null];
}

- (OFString*)description







|
|







43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

	[self release];

	pool = [[OFAutoreleasePool alloc] init];

	if (![[element name] isEqual: [self className]] ||
	    ![[element namespace] isEqual: OF_SERIALIZATION_NS])
		@throw [OFInvalidArgumentException exceptionWithClass: isa
							     selector: _cmd];

	[pool release];

	return [OFNull null];
}

- (OFString*)description
97
98
99
100
101
102
103
104
105
106
107
108
- (unsigned int)retainCount
{
	return OF_RETAIN_COUNT_MAX;
}

- (void)dealloc
{
	@throw [OFNotImplementedException newWithClass: isa
					      selector: _cmd];
	[super dealloc];	/* Get rid of a stupid warning */
}
@end







|
|



97
98
99
100
101
102
103
104
105
106
107
108
- (unsigned int)retainCount
{
	return OF_RETAIN_COUNT_MAX;
}

- (void)dealloc
{
	@throw [OFNotImplementedException exceptionWithClass: isa
						    selector: _cmd];
	[super dealloc];	/* Get rid of a stupid warning */
}
@end