-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix retain cycle between cell and view controller #1725
Fix retain cycle between cell and view controller #1725
Conversation
Jordan Morgan seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Please add a unit test that verifies the cycle is gone. See #1429 for an example. Thanks! |
@DreamingInBinary Mind updating the PR with a test and signing the CLA so we can merge this? |
@rahul-malik Sorry about the radio silence - had a few things come up and went out for the holidays. I'll get this in this week 👍 |
@rahul-malik tests added 👍 |
Podfile.lock
Outdated
|
||
COCOAPODS: 1.6.0 | ||
COCOAPODS: 1.8.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't expect to see podfile changes with this diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the pod file changes, and things look good. Thanks!
@bolsinga I wasn't sure of the best way to undo the |
I think you need to merge with master... |
@@ -1390,8 +1392,6 @@ | |||
83A7D95D1D446A6E00BF333E /* ASWeakMapTests.mm */, | |||
CC3B208D1C3F7D0A00798563 /* ASWeakSetTests.mm */, | |||
695BE2541DC1245C008E6EA5 /* ASWrapperSpecSnapshotTests.mm */, | |||
407B8BAD2310E2ED00CB979E /* ASLayoutSpecUtilitiesTests.mm */, | |||
CC698826247855F200487428 /* UIImage+ASConvenienceTests.mm */, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's close, but it looks like your diff removes this file. If you reset the project file back to master and re-add ASCellNodeTests.m, I think it will be good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bolsinga Sorry for the back and forth here Greg!
So I took master's .pbxproj, and then added back in my new file (ASCellNodeTests.mm
) and it doesn't appear to remove ASLayoutSpecUtilitiesTests.mm
or UIImage+ASConvenienceTests.mm
but rather seems to shift where they are in that particular file if I'm seeing things correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Sorry for my delay in finding your response and update.
Looks like the license still needs to be accepted. I’ll land once that is complete. Thanks! |
@bolsinga Done! |
In the UI I see, it still says "Jordan Morgan" has not signed this, but "DreamingInBinary" has. Maybe those two accounts are not fully associated with each other? I don't know why there are 2 associated with this PR in the first place... |
@bolsinga did you manage to sign? |
Hi @mycroftcanner It's @DreamingInBinary that needs to sign the CLA. @DreamingInBinary would you be able to remove the unsigned committer, or sign them? Thanks! |
@bolsinga @DreamingInBinary Interested in the PR, however, I think it has an unwanted side effect. I've got an ASPagerNode setup and as I move out of range of a pager it's being retained indefinitely. As I'm using the AsPagerNode as one of my main tabs, this memory never gets freed. I've used the fix applied in the PR. However, there seem to be unwanted side effects. The ASPagerNode and I believe all ASCollectionNode's initialize their dataset and expect all nodes to be left around. The view controller included. The problem is, this now (I think correctly, deinit's each view controller as it goes off-screen). The problem is the ASPagerNode never re-creates it so you end up with empty pages. See the ASPagerNode documentation below. It seems to indicate that it's not called when the nodes are about to display and seems to be called in one batch as the dataset is applied. This means once deallocated pages, they're not able to be re-created. I'm curious on two fronts, this fix in the PR seems correct to me. Nodes not in the range, that have disappeared should be allowed to deinit and free up memory. They should then be recreated. Neither the current logic or the PR allow that. Maybe a tweak is needed in re-creating nodes as they come into view. @nguyenhuy @rahul-malik might be able to shed some light, but it looks like this PR has unwanted side effects or at the very least is a breaking change based on the assumptions of ASCollectionNode's allocation. I'd love to understand this a little more.
From here |
In reference to this issue.