You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run the code directly, it would hit the assert in ASDisplayNode(CALayerDelegate) method "actionForLayer:forKey", as mentioned in #910. This looks strange because the 4 _clipCornerLayers are setting "self" as layerDelegate, but the delegate method needs self to be isLayerBacked == true(sometimes we need subnodes to receive touch events so we can't set isLayerBacked). Seems this delegate method isn't for the clipping layers?
And if I try to comment out the assert code(same effect as release build), or just return nil in the delegate method(shouldn't affect because the node is not layerBacked), the app crashes when we remove the node from parent view.
Call stack:
Turning on Zombie Objects in build scheme and we get:
2018-07-11 17:49:13.871070+0800 cornerClippingCrash[19362:291616] *** -[ASDisplayNode isKindOfClass:]: message sent to deallocated instance 0x7fe735c05c40
Looks like UIKit is calling the clippingLayer's delegate(aka the node) for some work, but the node has already been deallocated in [ASDisplayView didMoveToSuperView:]
If we don't set the node as clippingLayer's delegate, the issue is gone. Is it possible not to set the delegate? @nguyenhuy@appleguy
The text was updated successfully, but these errors were encountered:
Sample code is just a few lines, creating a plain ASDisplayNode, setting cornerRadius/ cornerRoundingType, and adding it to a view:
https://github.com/yxztj/cornerRoundingCrash
If you run the code directly, it would hit the assert in ASDisplayNode(CALayerDelegate) method "actionForLayer:forKey", as mentioned in #910. This looks strange because the 4 _clipCornerLayers are setting "self" as layerDelegate, but the delegate method needs self to be isLayerBacked == true(sometimes we need subnodes to receive touch events so we can't set isLayerBacked). Seems this delegate method isn't for the clipping layers?
And if I try to comment out the assert code(same effect as release build), or just return nil in the delegate method(shouldn't affect because the node is not layerBacked), the app crashes when we remove the node from parent view.
Call stack:
![screen shot 2018-07-11 at 5 58 06 pm](https://user-images.githubusercontent.com/3334458/42564689-020b8a38-8534-11e8-9ea4-a17d129a1bb5.png)
Turning on Zombie Objects in build scheme and we get:
Looks like UIKit is calling the clippingLayer's delegate(aka the node) for some work, but the node has already been deallocated in [ASDisplayView didMoveToSuperView:]
If we don't set the node as clippingLayer's delegate, the issue is gone. Is it possible not to set the delegate?
@nguyenhuy @appleguy
The text was updated successfully, but these errors were encountered: