Skip to content

Fix LocalHistoryEntry leak when double tapping Drawer scrim - #191064

Draft
Mairramer wants to merge 6 commits into
flutter:masterfrom
Mairramer:fix-drawer-double-tap
Draft

Fix LocalHistoryEntry leak when double tapping Drawer scrim#191064
Mairramer wants to merge 6 commits into
flutter:masterfrom
Mairramer:fix-drawer-double-tap

Conversation

@Mairramer

Copy link
Copy Markdown
Contributor

Fixes #133740

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@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 Aug 13, 2026
@Mairramer

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates the DrawerControllerState to ensure that _historyEntry is properly removed and nullified when the drawer is dismissed, closed, or dragged closed, preventing leaks of LocalHistoryEntry. A test is also added to verify this behavior. The review feedback suggests checking the mounted property before calling close in _handleHistoryEntryRemoved to avoid potential crashes during teardown, and refactoring the repeated history entry cleanup logic into a helper method.

Comment thread packages/flutter/lib/src/material/drawer.dart
Comment thread packages/flutter/lib/src/material/drawer.dart Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

Tapping outside of drawer twice to dismiss it breaks swipe to go back

1 participant