Skip to content

Commit af1b749

Browse files
authored
RenderParagraph should dispose instances of SelectableFragments. (#133915)
1 parent c9f70e9 commit af1b749

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/flutter/lib/src/rendering/paragraph.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,7 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo
437437
@override
438438
void dispose() {
439439
_removeSelectionRegistrarSubscription();
440-
// _lastSelectableFragments may hold references to this RenderParagraph.
441-
// Release them manually to avoid retain cycles.
442-
_lastSelectableFragments = null;
440+
_disposeSelectableFragments();
443441
_textPainter.dispose();
444442
super.dispose();
445443
}

packages/flutter/test/material/elevated_button_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ void main() {
16841684
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic);
16851685
});
16861686

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

0 commit comments

Comments
 (0)