diff --git a/Source/Additions/GCObject.m b/Source/Additions/GCObject.m index 8f59cb96b..612e5a243 100644 --- a/Source/Additions/GCObject.m +++ b/Source/Additions/GCObject.m @@ -168,6 +168,8 @@ static BOOL isCollecting = NO; { allObjects = (_GCObjectList*) NSAllocateObject([_GCObjectList class], 0, NSDefaultMallocZone()); + allObjects->gc.next = allObjects; + allObjects->gc.previous = allObjects; } } diff --git a/Testing/basic.m b/Testing/basic.m index 6002e59aa..90d705276 100644 --- a/Testing/basic.m +++ b/Testing/basic.m @@ -1,4 +1,5 @@ #include +#include #include @@ -37,6 +38,14 @@ int main () NSString *s; NSArray *a = [NSArray arrayWithObjects: @"a", @"b", nil]; + o = [GCMutableArray new]; + x = [GCMutableArray new]; + [o addObject: x]; + [x addObject: o]; + [o release]; + [x release]; + [GCObject gcCollectGarbage]; + o = [NSDictionary dictionaryWithObjectsAndKeys: @"test", @"one", [NSNumber numberWithBool: YES], @"two",