Unverified Commit 8953ba65 authored by Kostia Sokolovskyi's avatar Kostia Sokolovskyi Committed by GitHub

Fix memory leak in Overlay.wrap. (#145744)

parent 15832892
......@@ -863,6 +863,12 @@ class _WrappingOverlayState extends State<_WrappingOverlay> {
_entry.markNeedsBuild();
}
@override
void dispose() {
_entry..remove()..dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Overlay(
......
......@@ -1550,10 +1550,7 @@ void main() {
});
});
testWidgets('Overlay.wrap',
// TODO(ksokolovskyi): dispose OverlayEntry, https://github.com/flutter/flutter/issues/145687 [leaks-to-clean]
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
testWidgets('Overlay.wrap', (WidgetTester tester) async {
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
......@@ -1585,10 +1582,7 @@ void main() {
expect(tester.state(find.byType(Overlay)), same(overlayState));
});
testWidgets('Overlay.wrap is sized by child in an unconstrained environment',
// TODO(ksokolovskyi): dispose OverlayEntry, https://github.com/flutter/flutter/issues/145687 [leaks-to-clean]
experimentalLeakTesting: LeakTesting.settings.withIgnoredAll(),
(WidgetTester tester) async {
testWidgets('Overlay.wrap is sized by child in an unconstrained environment', (WidgetTester tester) async {
await tester.pumpWidget(
Directionality(
textDirection: TextDirection.ltr,
......
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