Closed alexeyzernov closed 10 years ago
Hm... Is there a crash file you can provide?
It was 2 days ago.I removed this method because I don't need OS X <= 10.7 support. Can you try by yourself with -Os optimization? Everything is ok?
If I can reproduce it then sure. I'll try, but if I can't then you'll have to help me out.
Just compile your IT-Switch-Demo application for release, you'll see the crash. If your want to debug this problem then change optimization level in debug to "-Os" and run.
it_CFAutorelease(result);
is responsible.
@inket Jep. The problem is that there is no real alternative to CFAutorelease for previ
Damnit. Writing on mobile is no good. I was gonna say that there is no good alternative. It's recommended to just return a retained object from the method, but that doesn't fully satisfy the static analyzer. i'm looking for a solution.
Same probleme here. I've temporarily used : -(CGColorRef)it_CGColor { return [self CGColor]; } instead.
Supporting < 10.8 when 10.10 is landing seems really not needed to me.
Yes, altimac's temporary fix worked for me too. Thanks a lot :) and thanks iluuu1994 for this awesome switch.
// ---------------------------------------------------------------------------------------
pragma mark - NSColor Addition for OS X <= 10.7 support
// ---------------------------------------------------------------------------------------
....
(CGColorRef)it_CGColor { const NSInteger numberOfComponents = [self numberOfComponents]; CGFloat components[numberOfComponents]; CGColorSpaceRef colorSpace = [[self colorSpace] CGColorSpace];
[self getComponents:(CGFloat *)&components];
CGColorRef result = CGColorCreate(colorSpace, components); it_CFAutorelease(result);
return result; }
.....
Crashed on run with release target. Release used compiler optimization with option -Os . Debug version runs fine.