Index: src/OFAutoreleasePool.m ================================================================== --- src/OFAutoreleasePool.m +++ src/OFAutoreleasePool.m @@ -87,10 +87,19 @@ return self; } - free { + /* + * FIXME: + * Maybe we should get the objects ourself, release them and then + * release the pool without calling its release method? This way, + * there wouldn't be a recursion. + */ + if (listobj->next != NULL) + [listobj->next->object release]; + [[OFThread objectForTLSKey: pool_list_key] remove: listobj]; return [super free]; } @@ -120,6 +129,20 @@ [objects release]; objects = nil; return self; } + +- retain +{ + // FIXME: Maybe another exception would be better here? + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} + +- autorelease +{ + // FIXME: Maybe another exception would be better here? + @throw [OFNotImplementedException newWithClass: isa + andSelector: _cmd]; +} @end Index: tests/OFAutoreleasePool/OFAutoreleasePool.m ================================================================== --- tests/OFAutoreleasePool/OFAutoreleasePool.m +++ tests/OFAutoreleasePool/OFAutoreleasePool.m @@ -95,12 +95,9 @@ o2 = [[[OFObject alloc] init] autorelease]; pool2 = [[OFAutoreleasePool alloc] init]; o3 = [[[OFObject alloc] init] autorelease]; - [pool1 retain]; [pool1 release]; - [pool1 release]; - [o3 free]; - return (inits == 20 && retains == 6 && releases == 13 ? 0 : 1); + return (inits == 20 && retains == 5 && releases == 16 ? 0 : 1); }