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 a memory leak in AutomaticKeepAlive
#124163
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
Can you please add a test for this to make sure it doesn't get regressed? |
@dnfield Should be all set! |
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.
LGTM
Great! This will need a second review from a contributor to land. |
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.
Did something go wrong with rebasing or updating this branch? Or is it really supposed to touch 158 files? (removing the auto submit label for now) |
@goderbauer Looks like GitHub's online UI messed up the rebase. Same thing happened to me yesterday. I'll fix it |
Thanks. Re-added the label. |
auto label is removed for flutter/flutter, pr: 124163, due to - The status or check suite Mac framework_tests_libraries has failed. Please fix the issues identified (or deflake) before re-applying this label. |
Going to rebase to trigger a re-test. Shouldn't be related to this PR since everything passed before. |
Next time, just send a ping. We and re-run most tests individually. The Google testing one is a special one. :) |
Ok! Would you please remove the autosubmit for a second? Looks like a rebase somewhere got messed up and changed the engine.version. I'll sort it out |
Branch should be fixed & up to date, ready for auto-submit. Sorry about the hassle! Lesson learned: will not be using GitHub's online branch update feature in the future 🙃 |
you could use this hack to fix 'update rebase (from github) mess' - https://sirolad.medium.com/other-peoples-commit-in-my-pull-request-github-afc1fa7528ea |
@Piinks Hi! Is the google testing error still unrelated to this PR? Would a rebase help? Or should it be manually rerun? Also, this PR should be all set for autosubmit! |
Previously, if a KeepAliveHandle outlived an AutomaticKeepAlive, it'd cause a memory leak by holding onto the AutomaticKeepAlive.
Hey @GregoryConrad sorry our CI has been having some troubles the last few days. I've rebased this to see if we can get this landed. There is another change that caused a lot of failures that has been getting caught up in other tests. Thanks for your patience. |
why did number of checks reduced to just 9?! |
Fix a memory leak in `AutomaticKeepAlive`
Previously, if a KeepAliveHandle outlived an AutomaticKeepAlive (e.g., switching locations in the tree), it'd cause a memory leak by holding onto the AutomaticKeepAlive. This PR fixes that leak by calling
removeListener
once the listener is fired. See more: #123864 (comment)This PR was spun off of #123864.
CC @dnfield @Piinks