Skip to content

Commit

Permalink
RenderParagraph should dispose instances of SelectableFragments. (#13…
Browse files Browse the repository at this point in the history
…3915)
  • Loading branch information
polina-c authored Sep 5, 2023
1 parent c9f70e9 commit af1b749
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/flutter/lib/src/rendering/paragraph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,7 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo
@override
void dispose() {
_removeSelectionRegistrarSubscription();
// _lastSelectableFragments may hold references to this RenderParagraph.
// Release them manually to avoid retain cycles.
_lastSelectableFragments = null;
_disposeSelectableFragments();
_textPainter.dispose();
super.dispose();
}
Expand Down
2 changes: 1 addition & 1 deletion packages/flutter/test/material/elevated_button_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ void main() {
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
});

testWidgets('ElevatedButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async {
testWidgetsWithLeakTracking('ElevatedButton in SelectionArea changes mouse cursor when hovered', (WidgetTester tester) async {
// Regression test for https://github.com/flutter/flutter/issues/104595.
await tester.pumpWidget(MaterialApp(
home: SelectionArea(
Expand Down

0 comments on commit af1b749

Please sign in to comment.