Differences From Artifact [2fd942db62]:
- File src/OFAutoreleasePool.m — part of check-in [e0163c30a9] at 2009-05-23 01:59:42 on branch trunk — Prevent + initialize from being called twice. (user: js, size: 3198) [annotate] [blame] [check-ins using]
To Artifact [bd25c897fc]:
- File
src/OFAutoreleasePool.m
— part of check-in
[526d04018d]
at
2009-05-23 21:53:20
on branch trunk
— A few renames.
OFArray:
* -[add:] to -[addObject:].
* -[last] to -[lastObject].OFAutoreleasePool:
* +[addToPool:] to +[addObjectToTopmostPool:].
* -[addToPool:] to -[addObject:].OFDataArray:
* -[add:] to -[addItem:].
* -[last] to -[lastItem].OFObject:
* -[addToMemoryPool:] to -[addItemToMemoryPool:]. (user: js, size: 3217) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
40 41 42 43 44 45 46 |
{
if (self != [OFAutoreleasePool class])
return;
pool_list_key = [[OFTLSKey alloc] initWithDestructor: release_list];
}
| | | | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
{
if (self != [OFAutoreleasePool class])
return;
pool_list_key = [[OFTLSKey alloc] initWithDestructor: release_list];
}
+ (void)addObjectToTopmostPool: (OFObject*)obj
{
OFList *pool_list = [OFThread objectForTLSKey: pool_list_key];
if (pool_list == nil || [pool_list last] == NULL) {
@try {
[[self alloc] init];
pool_list = [OFThread objectForTLSKey: pool_list_key];
} @catch (OFException *e) {
[obj release];
@throw e;
}
}
if (pool_list == nil || [pool_list last] == NULL) {
[obj release];
@throw [OFInitializationFailedException newWithClass: self];
}
@try {
[[pool_list last]->object addObject: obj];
} @catch (OFException *e) {
[obj release];
@throw e;
}
}
- init
|
| ︙ | ︙ | |||
121 122 123 124 125 126 127 | [self releaseObjects]; [[OFThread objectForTLSKey: pool_list_key] remove: listobj]; [super dealloc]; } | | | | 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
[self releaseObjects];
[[OFThread objectForTLSKey: pool_list_key] remove: listobj];
[super dealloc];
}
- addObject: (OFObject*)obj
{
if (objects == nil)
objects = [[OFMutableArray alloc] init];
[objects addObject: obj];
[obj release];
return self;
}
- (void)release
{
|
| ︙ | ︙ |