@@ -262,9 +262,24 @@ [self addObject: object]; } } else for (id object in set) [self addObject: object]; + + objc_autoreleasePoolPop(pool); +} + +- (void)removeAllObjects +{ + void *pool = objc_autoreleasePoolPush(); + OFSet *copy = [[self copy] autorelease]; + + for (id object in copy) { + size_t count = [self countForObject: object]; + + for (size_t i = 0; i < count; i++) + [self removeObject: object]; + } objc_autoreleasePoolPop(pool); } @end