ClassyKit / Classy

Expressive, flexible, and powerful stylesheets for UIView and friends.
http://classykit.github.io/Classy/
MIT License
740 stars 76 forks source link

Crashes when applying styles while the controller is dismissing #109

Open drinking opened 8 years ago

drinking commented 8 years ago

When a controller is dismissing and rotating at the same time, In some conditions it will crash. I guess it depends on the sequence of updating style and releasing the view.

e6921743-f016-4f0e-b6df-583e816b17ee

mikeger commented 8 years ago

Hey, thanks for reporting. The bug is connected to the fact that cas_parent or cas_alternativeParent is assign and it contains the reference to the deallocated object instance, I actually have a fix for that making it weak

atsepkov commented 8 years ago

Is this not the same fix as committed here: https://github.com/ClassyKit/Classy/pull/97/commits?

I too am seeing a similar crash, although in different part of the code when switching between controllers:

screen shot 2016-04-01 at 9 26 59 pm

For me, I think the problem is that the Podspec (mentioning 0.2.4 version, which is back from 2014: https://github.com/ClassyKit/Classy/blob/master/Classy.podspec) is stale, and my local version keeps thinking it's the latest even though this fix wasn't submitted until 2015. My local version, for example, is missing Classy/Reflection/CASAssociatedObjectsWeakWrapper.m which was added with that pull request.