47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
release(iter->object, @selector(release));
[(OFList*)list release];
}
#endif
@implementation OFAutoreleasePool
+ (void)initialize
{
#ifndef _WIN32
if (pthread_key_create(&pool_list_key, release_list))
@throw [OFInitializationFailedException newWithClass: self];
#else
/* FIXME: Free stuff when thread is terminated! */
if ((pool_list_key = TlsAlloc()) == TLS_OUT_OF_INDEXES)
@throw [OFInitializationFailedException newWithClass: self];
#endif
}
+ (void)addToPool: (OFObject*)obj
{
OFList *pool_list = get_tls(pool_list_key);
if (pool_list == nil || [pool_list last] == NULL) {
|
|
>
>
|
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
|
release(iter->object, @selector(release));
[(OFList*)list release];
}
#endif
@implementation OFAutoreleasePool
+ initialize
{
#ifndef _WIN32
if (pthread_key_create(&pool_list_key, release_list))
@throw [OFInitializationFailedException newWithClass: self];
#else
/* FIXME: Free stuff when thread is terminated! */
if ((pool_list_key = TlsAlloc()) == TLS_OUT_OF_INDEXES)
@throw [OFInitializationFailedException newWithClass: self];
#endif
return self;
}
+ (void)addToPool: (OFObject*)obj
{
OFList *pool_list = get_tls(pool_list_key);
if (pool_list == nil || [pool_list last] == NULL) {
|