* 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.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23340 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2006-08-27 02:35:03 +00:00
parent a25584e559
commit 38cd6de498
5 changed files with 37 additions and 26 deletions

View file

@ -1,3 +1,14 @@
2006-08-26 22:30-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* 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 <greg_casamento@yahoo.com> 2006-08-26 18:25-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSTableView.m: initWithCoder: minor cleanup. * Source/NSTableView.m: initWithCoder: minor cleanup.

View file

@ -90,7 +90,7 @@
NS_HANDLER NS_HANDLER
{ {
NSLog(@"Exception occured while loading model: %@",[localException reason]); NSLog(@"Exception occured while loading model: %@",[localException reason]);
TEST_RELEASE(unarchiver); // TEST_RELEASE(unarchiver);
} }
NS_ENDHANDLER NS_ENDHANDLER

View file

@ -1253,17 +1253,17 @@ systemColorWithName(NSString *name)
if (colorSpace == 1) if (colorSpace == 1)
{ {
self = [NSColor colorWithCalibratedRed: red self = RETAIN([NSColor colorWithCalibratedRed: red
green: green green: green
blue: blue blue: blue
alpha: alpha]; alpha: alpha]);
} }
else else
{ {
self = [NSColor colorWithDeviceRed: red self = RETAIN([NSColor colorWithDeviceRed: red
green: green green: green
blue: blue blue: blue
alpha: alpha]; alpha: alpha]);
} }
} }
else if ((colorSpace == 3) || (colorSpace == 4)) else if ((colorSpace == 3) || (colorSpace == 4))
@ -1289,13 +1289,13 @@ systemColorWithName(NSString *name)
if (colorSpace == 3) if (colorSpace == 3)
{ {
self = [NSColor colorWithCalibratedWhite: white self = RETAIN([NSColor colorWithCalibratedWhite: white
alpha: alpha]; alpha: alpha]);
} }
else else
{ {
self = [NSColor colorWithDeviceWhite: white self = RETAIN([NSColor colorWithDeviceWhite: white
alpha: alpha]; alpha: alpha]);
} }
} }
else if (colorSpace == 5) else if (colorSpace == 5)
@ -1325,11 +1325,11 @@ systemColorWithName(NSString *name)
RELEASE(str); RELEASE(str);
} }
self = [NSColor colorWithDeviceCyan: cyan self = RETAIN([NSColor colorWithDeviceCyan: cyan
magenta: magenta magenta: magenta
yellow: yellow yellow: yellow
black: black black: black
alpha: alpha]; alpha: alpha]);
} }
else if (colorSpace == 6) else if (colorSpace == 6)
{ {
@ -1337,14 +1337,14 @@ systemColorWithName(NSString *name)
NSString *name = [aDecoder decodeObjectForKey: @"NSColorName"]; NSString *name = [aDecoder decodeObjectForKey: @"NSColorName"];
//NSColor *color = [aDecoder decodeObjectForKey: @"NSColor"]; //NSColor *color = [aDecoder decodeObjectForKey: @"NSColor"];
self = [NSColor colorWithCatalogName: catalog self = RETAIN([NSColor colorWithCatalogName: catalog
colorName: name]; colorName: name]);
} }
else if (colorSpace == 10) else if (colorSpace == 10)
{ {
NSImage *image = [aDecoder decodeObjectForKey: @"NSImage"]; NSImage *image = [aDecoder decodeObjectForKey: @"NSImage"];
self = [NSColor colorWithPatternImage: image]; self = RETAIN([NSColor colorWithPatternImage: image]);
} }
return self; return self;

View file

@ -862,7 +862,7 @@ static Class actionCellClass;
if ([aDecoder allowsKeyedCoding]) if ([aDecoder allowsKeyedCoding])
{ {
NSCell *cell = [aDecoder decodeObjectForKey: @"NSCell"]; NSCell *cell = RETAIN([aDecoder decodeObjectForKey: @"NSCell"]);
if (cell != nil) if (cell != nil)
{ {

View file

@ -1186,22 +1186,22 @@ static BOOL flip_hack;
// FIXME // FIXME
if (flags == 16) if (flags == 16)
{ {
return [NSFont controlContentFontOfSize: size]; return RETAIN([NSFont controlContentFontOfSize: size]);
} }
else if (flags == 20) else if (flags == 20)
{ {
return [NSFont labelFontOfSize: size]; return RETAIN([NSFont labelFontOfSize: size]);
} }
else if (flags == 22) else if (flags == 22)
{ {
return [NSFont titleBarFontOfSize: size]; return RETAIN([NSFont titleBarFontOfSize: size]);
} }
} }
self = [NSFont fontWithName: name size: size]; self = [NSFont fontWithName: name size: size];
if (self == nil) if (self == nil)
{ {
self = [NSFont systemFontOfSize: size]; self = RETAIN([NSFont systemFontOfSize: size]);
} }
return self; return self;