Skip to content

Commit aa1bacb

Browse files
authored
Leaks fix. (flutter#132778)
Fixes flutter#132769
1 parent f0bfd7d commit aa1bacb

File tree

4 files changed

+3
-8
lines changed

4 files changed

+3
-8
lines changed

packages/flutter/lib/src/material/menu_anchor.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ class _MenuAnchorState extends State<MenuAnchor> {
303303
_anchorChildren.clear();
304304
_menuController._detach(this);
305305
_internalMenuController = null;
306+
_menuScopeNode.dispose();
306307
super.dispose();
307308
}
308309

@@ -551,6 +552,7 @@ class _MenuAnchorState extends State<MenuAnchor> {
551552
}
552553
_closeChildren(inDispose: inDispose);
553554
_overlayEntry?.remove();
555+
_overlayEntry?.dispose();
554556
_overlayEntry = null;
555557
if (!inDispose) {
556558
// Notify that _childIsOpen changed state, but only if not

packages/flutter/lib/src/widgets/focus_manager.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,7 @@ class FocusManager with DiagnosticableTreeMixin, ChangeNotifier {
14801480
@override
14811481
void dispose() {
14821482
_highlightManager.dispose();
1483+
rootScope.dispose();
14831484
super.dispose();
14841485
}
14851486

packages/flutter/test/material/menu_bar_theme_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// Fails with "flutter test --test-randomize-ordering-seed=20230817"
6-
@Tags(<String>['no-shuffle'])
7-
library;
8-
95
import 'package:flutter/material.dart';
106
import 'package:flutter_test/flutter_test.dart';
117
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

packages/flutter/test/material/menu_theme_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
// Fails with "flutter test --test-randomize-ordering-seed=20230817"
6-
@Tags(<String>['no-shuffle'])
7-
library;
8-
95
import 'package:flutter/material.dart';
106
import 'package:flutter_test/flutter_test.dart';
117
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';

0 commit comments

Comments
 (0)