Selector 'release' sent to dealloced instance of class NSDeviceRGBColor ??
Selector 'release' sent to dealloced instance of class NSDeviceRGBColor ??
- Subject: Selector 'release' sent to dealloced instance of class NSDeviceRGBColor ??
- From: Jonathan del Strother <email@hidden>
- Date: Sun, 2 Oct 2005 00:31:38 +0100
I've got an odd over-release problem here that I can't figure out.
I'm debugging with zombies enabled, and run into this :
Selector 'release' sent to dealloced instance 0x8bb85b0 of class
NSDeviceRGBColor.
This occurs in the application's normal autorelease pool.
What's particularly odd about it is that there is nowhere where I do
any of my own memory management on an NSColor - I'm relying entirely
on class methods returning autoreleased objects. I don't call
retain, release, or autorelease on an NSColor in this program.
After a bit of tracking down, I *think* I've pinpointed the call
that's causing the problem :
-(void)setColor:(NSColor*)targetColor
{
ATSUAttributeTag tags[1];
ByteCount sizes[1];
ATSUAttributeValuePtr values[1];
NSColor* targetRGB = [targetColor
colorUsingColorSpaceName:NSDeviceRGBColorSpace];
NSLog(@"%x, %x", targetColor, targetRGB);
ATSURGBAlphaColor color;
color.red = [targetRGB redComponent];
color.green = [targetRGB greenComponent];
color.blue = [targetRGB blueComponent];
color.alpha = [targetRGB alphaComponent];
tags[0] = kATSURGBAlphaColorTag;
sizes[0] = sizeof(ATSURGBAlphaColor);
values[0] = &color;
verify_noerr( ATSUSetAttributes(style, 1, tags, sizes, values) );
}
The address of targetRGB is the one later given in the zombie
warning. Note that targetRGB should be an autoreleased NSColor, and
I'm not retaining or releasing it at all. (If I do add a retain in
there, there's no zombie report, but obviously that's a rather
dubious 'solution')
Any suggestions where to go from here? Anything I might try? I'm a
bit stumped...
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden