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
RenderParagraph should dispose instances of SelectableFragments. #133915
Conversation
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 with small nit.
auto label is removed for flutter/flutter/133915, due to - The status or check suite Mac customer_testing has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
@@ -437,6 +437,7 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo | |||
@override | |||
void dispose() { | |||
_removeSelectionRegistrarSubscription(); | |||
_disposeSelectableFragments(); | |||
// _lastSelectableFragments may hold references to this RenderParagraph. | |||
// Release them manually to avoid retain cycles. | |||
_lastSelectableFragments = null; |
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 think we can remove this line (443) and put _disposeSelectableFragments
under the comment since it already nulls _lastSelectableFragments
.
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.
Indeed. Thank you.
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 do not think the comment is relevant any more.
No description provided.