-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTAttributedTextContentView will cause Zombie layer object crash when Using DTTiledLayerWithoutFade #1250
Comments
seems DTAttributedTextContentView emebed in TableViewCell is also a key point to crash |
And I found this problem only exist in TableviewCells(or the view directly added as UITableView's subview) who got a DTAttributedTextContentView as its subview , and if this DTAttributedTextContentView has any subview , this subview's layer will be deallocated before the subview deallocated . so this makes the zombie happen |
I guess you shouldn't use tiling inside table view cells! |
@odrobnik But in DTAttributedTextContentView's layoutSubviews , there will be a warning about this
And In my project the DTAttributedTextContentView 's size may bigger that 1024 often. |
That's from a long time ago. If you find that non-tiling works with greater view sizes, then you can increase the size and send a PR. |
OK, I 'll test non-tiling mode in my project for a while , In fact , the HTML to be rendered in my project may contains many pictures( 100 + pictures,each of them got a file size bigger then 500K) , If it turns out that non-tiling works well for even this extreme situation , I will let you know and send a PR . . Thanks @odrobnik |
@ximmyxiao what was the PR you wanted to suggest? Just to take out the warning? |
@odrobnik YES,in my project I just omit this warning , maybe a variable indicated that this DTAttributedTextContentView is contained in the UITableView or not , and the warning will be generated on this variable . Both of these method seems not so beautiful maybe , What do you think is the best way to fix this |
@ximmyxiao well, we can probably simple remove the warning. Or possibly put in a check if the view has a tableview in its super path to warn about tiling instead. i.e. inside a tableview cell, we warn if there is tiling, otherwise we warn if the view is large and there is no tiling. |
@odrobnik OK, I have just just published my app with this change(omit the warning) , I 'll let you know if this change is good or not after one or two weeks |
@odrobnik After watching my app in 2 weeks ,everything go well after 1 remove the using of DTTiledLayerWithoutFade 2 omit the warning . I think the new version of DTCoreText can do something similar change |
@odrobnik Can you do me a favour to look at this problem? This crash bothered my project for years , and I don't know how to fix it
the problem seems like when DTAttributedTextContentView 's layer is using DTTiledLayerWithoutFade, any subview added to DTAttributedTextContentView will be deallocated unexpected when the whole tableview deallocating . and this will cause some crash.
I reproduce the crash with the official example of DTCoreText, You guys can see the commit here:
https://github.com/ximmyxiao/DTCoreText/commit/cbad674d10ff33fd5cce7c9d6ca5e19602a58f93
The text was updated successfully, but these errors were encountered: