Skip to content

Fix memory leaks in DateRangePickerDialog. [prod-leak-fix] - #136034

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
ksokolovskyi:date-range-picker-leaks
Oct 6, 2023
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
ksokolovskyi:date-range-picker-leaks

Conversation

@ksokolovskyi

@ksokolovskyi ksokolovskyi commented Oct 5, 2023 •

Copy link
Copy Markdown
Contributor

This PR mainly fixes several memory leaks in the DateRangePickerDialog.

Description

Tests

  • Updates test/material/date_picker_theme_test.dart to use testWidgetsWithLeakTracking;
  • Updates test/material/date_range_picker_test.dart to use testWidgetsWithLeakTracking.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages labels Oct 5, 2023
@TahaTesser
TahaTesser self-requested a review October 5, 2023 14:16
Comment thread packages/flutter/lib/src/rendering/proxy_box.dart Outdated
@TahaTesser

Copy link
Copy Markdown
Contributor

@ksokolovskyi
Thanks for the PR!

@ksokolovskyi

Copy link
Copy Markdown
Contributor Author

cc @polina-c

@polina-c polina-c added the a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker label Oct 5, 2023
@polina-c

polina-c commented Oct 5, 2023

Copy link
Copy Markdown
Contributor

LGTM. I would like @TahaTesser 's lgtm before merging this.

@TahaTesser TahaTesser left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@TahaTesser TahaTesser added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2023
@auto-submit
auto-submit Bot merged commit d76e3ab into flutter:master Oct 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Oct 6, 2023
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Oct 6, 2023
flutter/flutter@fe0275f...ad20089

2023-10-06 [email protected] Roll Flutter Engine from cc9bc9e2c0d3 to 59b6b94e1a51 (1 revision) (flutter/flutter#136066)
2023-10-06 [email protected] Fix memory leaks in DateRangePickerDialog. (flutter/flutter#136034)
2023-10-06 [email protected] Roll Flutter Engine from 6492e1f8c315 to cc9bc9e2c0d3 (1 revision) (flutter/flutter#136062)
2023-10-06 [email protected] Tiny improve code style by using records instead of lists (flutter/flutter#135886)
2023-10-05 [email protected] Roll Flutter Engine from 27a674466094 to 6492e1f8c315 (1 revision) (flutter/flutter#136052)
2023-10-05 [email protected] Upload frame_request_pending_latency [attempt #2] (flutter/flutter#135890)
2023-10-05 [email protected] Roll Flutter Engine from 0ff05464f42f to 27a674466094 (1 revision) (flutter/flutter#136050)
2023-10-05 [email protected] Roll Flutter Engine from ad83202a59a6 to 0ff05464f42f (1 revision) (flutter/flutter#136047)
2023-10-05 [email protected] Roll Flutter Engine from f8d53c5fe9f2 to ad83202a59a6 (2 revisions) (flutter/flutter#136040)
2023-10-05 [email protected] Roll Packages from d654f75 to 6714d50 (3 revisions) (flutter/flutter#136039)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
This PR mainly fixes several memory leaks in the `DateRangePickerDialog`.

### Description
- Fixes flutter#136033 by:
    1) adding a disposal of several `RestorableValue`;
    2) creating a separate `_DayItem` stateful widget that creates/updates/disposes internal `MaterialStatesController`.
- Marks flutter#136036.

### Tests
- Updates `test/material/date_picker_theme_test.dart` to use `testWidgetsWithLeakTracking`;
- Updates `test/material/date_range_picker_test.dart` to use `testWidgetsWithLeakTracking`.
@polina-c polina-c changed the title Fix memory leaks in DateRangePickerDialog. Fix memory leaks in DateRangePickerDialog. [prod-leak-fix] Aug 29, 2024
creatorpiyush pushed a commit to creatorpiyush/packages that referenced this pull request Jun 10, 2026
flutter/flutter@fe0275f...ad20089

2023-10-06 [email protected] Roll Flutter Engine from cc9bc9e2c0d3 to 59b6b94e1a51 (1 revision) (flutter/flutter#136066)
2023-10-06 [email protected] Fix memory leaks in DateRangePickerDialog. (flutter/flutter#136034)
2023-10-06 [email protected] Roll Flutter Engine from 6492e1f8c315 to cc9bc9e2c0d3 (1 revision) (flutter/flutter#136062)
2023-10-06 [email protected] Tiny improve code style by using records instead of lists (flutter/flutter#135886)
2023-10-05 [email protected] Roll Flutter Engine from 27a674466094 to 6492e1f8c315 (1 revision) (flutter/flutter#136052)
2023-10-05 [email protected] Upload frame_request_pending_latency [attempt flutter#2] (flutter/flutter#135890)
2023-10-05 [email protected] Roll Flutter Engine from 0ff05464f42f to 27a674466094 (1 revision) (flutter/flutter#136050)
2023-10-05 [email protected] Roll Flutter Engine from ad83202a59a6 to 0ff05464f42f (1 revision) (flutter/flutter#136047)
2023-10-05 [email protected] Roll Flutter Engine from f8d53c5fe9f2 to ad83202a59a6 (2 revisions) (flutter/flutter#136040)
2023-10-05 [email protected] Roll Packages from d654f75 to 6714d50 (3 revisions) (flutter/flutter#136039)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
bisor0627 pushed a commit to bisor0627/packages that referenced this pull request Jun 19, 2026
flutter/flutter@fe0275f...ad20089

2023-10-06 [email protected] Roll Flutter Engine from cc9bc9e2c0d3 to 59b6b94e1a51 (1 revision) (flutter/flutter#136066)
2023-10-06 [email protected] Fix memory leaks in DateRangePickerDialog. (flutter/flutter#136034)
2023-10-06 [email protected] Roll Flutter Engine from 6492e1f8c315 to cc9bc9e2c0d3 (1 revision) (flutter/flutter#136062)
2023-10-06 [email protected] Tiny improve code style by using records instead of lists (flutter/flutter#135886)
2023-10-05 [email protected] Roll Flutter Engine from 27a674466094 to 6492e1f8c315 (1 revision) (flutter/flutter#136052)
2023-10-05 [email protected] Upload frame_request_pending_latency [attempt flutter#2] (flutter/flutter#135890)
2023-10-05 [email protected] Roll Flutter Engine from 0ff05464f42f to 27a674466094 (1 revision) (flutter/flutter#136050)
2023-10-05 [email protected] Roll Flutter Engine from ad83202a59a6 to 0ff05464f42f (1 revision) (flutter/flutter#136047)
2023-10-05 [email protected] Roll Flutter Engine from f8d53c5fe9f2 to ad83202a59a6 (2 revisions) (flutter/flutter#136040)
2023-10-05 [email protected] Roll Packages from b5426f2 to 77e4d18 (3 revisions) (flutter/flutter#136039)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: leak tracking Issues and PRs related to memory leaks detected by leak_tracker autosubmit Merge PR when tree becomes green via auto submit App framework flutter/packages/flutter repository. See also f: labels. p: material_ui material_ui package in flutter/packages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Memory Leak: DateRangePickerDialog has several memory leaks.

3 participants