iluuu1994 / ITSwitch

ITSwitch is a replica of UISwitch for Mac OS X
Apache License 2.0
290 stars 42 forks source link

compiler optimization with option -Os #15

Closed alexeyzernov closed 10 years ago

alexeyzernov commented 10 years ago

// ---------------------------------------------------------------------------------------

pragma mark - NSColor Addition for OS X <= 10.7 support

// ---------------------------------------------------------------------------------------

....

.....

Crashed on run with release target. Release used compiler optimization with option -Os . Debug version runs fine.

iluuu1994 commented 10 years ago

Hm... Is there a crash file you can provide?

alexeyzernov commented 10 years ago

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?

iluuu1994 commented 10 years ago

If I can reproduce it then sure. I'll try, but if I can't then you'll have to help me out.

alexeyzernov commented 10 years ago

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. screen shot 2014-06-23 at 23 40 30

inket commented 10 years ago

it_CFAutorelease(result); is responsible.

iluuu1994 commented 10 years ago

@inket Jep. The problem is that there is no real alternative to CFAutorelease for previ

iluuu1994 commented 10 years ago

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.

altimac commented 10 years ago

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.

rebeloper commented 10 years ago

Yes, altimac's temporary fix worked for me too. Thanks a lot :) and thanks iluuu1994 for this awesome switch.

iluuu1994 commented 10 years ago

18