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
@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();
}
......
......@@ -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(
......
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