diff --git a/ChangeLog b/ChangeLog index 0e1b1fc65..c49610525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2006-08-26 22:30-EDT Gregory John Casamento + + * Source/GSNibLoader.m: loadModelData:... Remove TEST_RELEASE + from handler block. + * Source/NSColor.m: initWithCoder: retain autoreleased instances + of NSColor to prevent double release when the pool is cleared. + * Source/NSControl.m: initWithCoder: retain cell to prevent + double release when the pool is cleared. + * Source/NSFont.m: initWithCoder: retain autoreleased instances + of NSFont to prevent double release when the pool is cleared. + 2006-08-26 18:25-EDT Gregory John Casamento * Source/NSTableView.m: initWithCoder: minor cleanup. diff --git a/Source/GSNibLoader.m b/Source/GSNibLoader.m index 03303df3a..fa3489172 100644 --- a/Source/GSNibLoader.m +++ b/Source/GSNibLoader.m @@ -90,7 +90,7 @@ NS_HANDLER { NSLog(@"Exception occured while loading model: %@",[localException reason]); - TEST_RELEASE(unarchiver); + // TEST_RELEASE(unarchiver); } NS_ENDHANDLER diff --git a/Source/NSColor.m b/Source/NSColor.m index f904a2e7c..34b952c3b 100644 --- a/Source/NSColor.m +++ b/Source/NSColor.m @@ -1253,17 +1253,17 @@ systemColorWithName(NSString *name) if (colorSpace == 1) { - self = [NSColor colorWithCalibratedRed: red - green: green - blue: blue - alpha: alpha]; + self = RETAIN([NSColor colorWithCalibratedRed: red + green: green + blue: blue + alpha: alpha]); } else { - self = [NSColor colorWithDeviceRed: red - green: green - blue: blue - alpha: alpha]; + self = RETAIN([NSColor colorWithDeviceRed: red + green: green + blue: blue + alpha: alpha]); } } else if ((colorSpace == 3) || (colorSpace == 4)) @@ -1289,13 +1289,13 @@ systemColorWithName(NSString *name) if (colorSpace == 3) { - self = [NSColor colorWithCalibratedWhite: white - alpha: alpha]; + self = RETAIN([NSColor colorWithCalibratedWhite: white + alpha: alpha]); } else { - self = [NSColor colorWithDeviceWhite: white - alpha: alpha]; + self = RETAIN([NSColor colorWithDeviceWhite: white + alpha: alpha]); } } else if (colorSpace == 5) @@ -1325,11 +1325,11 @@ systemColorWithName(NSString *name) RELEASE(str); } - self = [NSColor colorWithDeviceCyan: cyan - magenta: magenta - yellow: yellow - black: black - alpha: alpha]; + self = RETAIN([NSColor colorWithDeviceCyan: cyan + magenta: magenta + yellow: yellow + black: black + alpha: alpha]); } else if (colorSpace == 6) { @@ -1337,14 +1337,14 @@ systemColorWithName(NSString *name) NSString *name = [aDecoder decodeObjectForKey: @"NSColorName"]; //NSColor *color = [aDecoder decodeObjectForKey: @"NSColor"]; - self = [NSColor colorWithCatalogName: catalog - colorName: name]; + self = RETAIN([NSColor colorWithCatalogName: catalog + colorName: name]); } else if (colorSpace == 10) { NSImage *image = [aDecoder decodeObjectForKey: @"NSImage"]; - self = [NSColor colorWithPatternImage: image]; + self = RETAIN([NSColor colorWithPatternImage: image]); } return self; diff --git a/Source/NSControl.m b/Source/NSControl.m index 639aa2306..2d3ed1935 100644 --- a/Source/NSControl.m +++ b/Source/NSControl.m @@ -862,7 +862,7 @@ static Class actionCellClass; if ([aDecoder allowsKeyedCoding]) { - NSCell *cell = [aDecoder decodeObjectForKey: @"NSCell"]; + NSCell *cell = RETAIN([aDecoder decodeObjectForKey: @"NSCell"]); if (cell != nil) { diff --git a/Source/NSFont.m b/Source/NSFont.m index 4b05b3e25..d97b89d86 100644 --- a/Source/NSFont.m +++ b/Source/NSFont.m @@ -1186,22 +1186,22 @@ static BOOL flip_hack; // FIXME if (flags == 16) { - return [NSFont controlContentFontOfSize: size]; + return RETAIN([NSFont controlContentFontOfSize: size]); } else if (flags == 20) { - return [NSFont labelFontOfSize: size]; + return RETAIN([NSFont labelFontOfSize: size]); } else if (flags == 22) { - return [NSFont titleBarFontOfSize: size]; + return RETAIN([NSFont titleBarFontOfSize: size]); } } self = [NSFont fontWithName: name size: size]; if (self == nil) { - self = [NSFont systemFontOfSize: size]; + self = RETAIN([NSFont systemFontOfSize: size]); } return self;