[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory leak in _DraggableScrollableSheetState #134212

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,11 @@ class _DraggableScrollableSheetState extends State<DraggableScrollableSheet> {

@override
void dispose() {
widget.controller?._detach(disposeExtent: true);
if (widget.controller != null) {
Copy link
Contributor
@polina-c polina-c Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert it to make more readable:

if (widget.controller == null) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@polina-c thanks a lot for the review!
Added the fix.

widget.controller!._detach(disposeExtent: true);
} else {
_extent.dispose();
}
_scrollController.dispose();
super.dispose();
}
Expand Down
7 changes: 1 addition & 6 deletions packages/flutter/test/material/about_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1590,12 +1590,7 @@ void main() {
expect(titleOffset, const Offset(292.0, 136.0));
expect(titleOffset.dx, lessThan(wideSize.width - 320)); // Default master view width is 320.0.
expect(tester.getCenter(find.byType(ListView)), const Offset(160, 356));
},
leakTrackingTestConfig: const LeakTrackingTestConfig(
// TODO(polina-c): remove after fixing
// https://github.com/flutter/flutter/issues/133705
notDisposedAllowList: <String, int?> {'ValueNotifier<double>':5},
));
});

testWidgets('Material2 - LicensePage master view layout position - rtl', (WidgetTester tester) async {
const TextDirection textDirection = TextDirection.rtl;
Expand Down
Loading