diff --git a/ChangeLog b/ChangeLog index fd33ccb12..8a1747c16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-27 Richard Frith-Macdonald + + * Source/NSValue.m: ([valueWithNonretainedObject:]) zero the reference + when the object is collected. + 2009-01-25 Richard Frith-Macdonald * Source/NSURL.m: Compatibility tweaks for a few MacOS-X oddities... diff --git a/Source/GSConcreteValueTemplate.m b/Source/GSConcreteValueTemplate.m index 376005eea..caabf1261 100644 --- a/Source/GSConcreteValueTemplate.m +++ b/Source/GSConcreteValueTemplate.m @@ -90,8 +90,18 @@ * Ensure that the version encoded is that used by the abstract class. */ [self setVersion: [super version]]; +#if TYPE_ORDER == 0 && GS_WITH_GC + GSMakeWeakPointer(self, "data"); +#endif } +#if TYPE_ORDER == 0 && GS_WITH_GC +- (void) finalize +{ + GSAssignZeroingWeakPointer((void**)&data, (void*)nil); +} +#endif + // Allocating and Initializing - (id) initWithBytes: (const void *)value @@ -99,7 +109,11 @@ { typedef __typeof__(data) _dt; self = [super init]; +#if TYPE_ORDER == 0 && GS_WITH_GC + GSAssignZeroingWeakPointer((void**)&data, (void*)(*(id*)value)); +#else data = *(_dt *)value; +#endif return self; } diff --git a/Source/NSUnarchiver.m b/Source/NSUnarchiver.m index ac0632fa9..8a461e9aa 100644 --- a/Source/NSUnarchiver.m +++ b/Source/NSUnarchiver.m @@ -756,8 +756,7 @@ static Class NSDataMallocClass; */ if (c == nil) { - NSLog(@"Got nil when trying to unarchive class %s", - className); + NSLog(@"Unable to find class named '%s'", className); } [classInfo mapToClass: c withName: className]; [objDict setObject: classInfo forKey: className];