Differences From Artifact [1d59e36e29]:
- File
src/OFAutoreleasePool.m
— part of check-in
[af41efe079]
at
2009-05-14 13:46:00
on branch trunk
— Two small fixes for OFAutoreleasePool.
First, when an OFAutoreleasePool is deallocated, it should always
release all the objects.Second, releaseObject should also release the objects of the pools on
top of the current pool. (user: js, size: 2842) [annotate] [blame] [check-ins using]
To Artifact [3f9b8ad9ca]:
- File src/OFAutoreleasePool.m — part of check-in [bdc9b3219f] at 2009-05-14 14:24:02 on branch trunk — Get rid of OFNotInSetException. (user: js, size: 2741) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
39 40 41 42 43 44 45 | + (void)initialize { pool_list_key = [[OFTLSKey alloc] initWithDestructor: release_list]; } + (void)addToPool: (OFObject*)obj { | | < | < < | < < < < | < < | 39 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 | + (void)initialize { pool_list_key = [[OFTLSKey alloc] initWithDestructor: release_list]; } + (void)addToPool: (OFObject*)obj { OFList *pool_list = [OFThread objectForTLSKey: pool_list_key]; if (pool_list == nil || [pool_list last] == NULL) { [[self alloc] init]; pool_list = [OFThread objectForTLSKey: pool_list_key]; } if (pool_list == nil || [pool_list last] == NULL) @throw [OFInitializationFailedException newWithClass: self]; [[pool_list last]->object addToPool: obj]; } - init { OFList *pool_list; self = [super init]; objects = nil; if ((pool_list = [OFThread objectForTLSKey: pool_list_key]) == nil) { pool_list = [[OFList alloc] initWithoutRetainAndRelease]; [OFThread setObject: pool_list forTLSKey: pool_list_key]; [pool_list release]; } listobj = [pool_list append: self]; |
︙ | ︙ |