Unverified Commit af1b7494 authored by Polina Cherkasova's avatar Polina Cherkasova Committed by GitHub

RenderParagraph should dispose instances of SelectableFragments. (#133915)

parent c9f70e9f
...@@ -437,9 +437,7 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo ...@@ -437,9 +437,7 @@ class RenderParagraph extends RenderBox with ContainerRenderObjectMixin<RenderBo
@override @override
void dispose() { void dispose() {
_removeSelectionRegistrarSubscription(); _removeSelectionRegistrarSubscription();
// _lastSelectableFragments may hold references to this RenderParagraph. _disposeSelectableFragments();
// Release them manually to avoid retain cycles.
_lastSelectableFragments = null;
_textPainter.dispose(); _textPainter.dispose();
super.dispose(); super.dispose();
} }
......
...@@ -1684,7 +1684,7 @@ void main() { ...@@ -1684,7 +1684,7 @@ void main() {
expect(RendererBinding.instance.mouseTracker.debugDeviceActiveCursor(1), SystemMouseCursors.basic); 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. // Regression test for https://github.com/flutter/flutter/issues/104595.
await tester.pumpWidget(MaterialApp( await tester.pumpWidget(MaterialApp(
home: SelectionArea( home: SelectionArea(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment