You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TapGestureRecognizer leaked by _RenderSlider and _RenderRangeSlider #14204
changed the title [-]TapGestureRecognizer is not disposed in framework[/-][+]TapGestureRecognizer leaked by RenderToggleable, _RenderCupertinoSwitch, _RenderSlider[/+]on Jan 22, 2018
Problem is still present, we should fix it by creating the Recognizers on attach and disposing them on detach, similarly to how we fixed this for RenderEditable in #42076.
#76745 removed RenderToggleable but _RenderCupertinoSwitch and _RenderSlider still do not dispose of their TapGestureRecognizers. Updating the labels and removing RenderToggleable from the title to better reflect the current state of the issue.
changed the title [-]TapGestureRecognizer leaked by RenderToggleable, _RenderCupertinoSwitch, _RenderSlider[/-][+]TapGestureRecognizer leaked by `_RenderCupertinoSwitch`, `_RenderSlider`[/+]on Apr 17, 2023
changed the title [-]TapGestureRecognizer leaked by `_RenderCupertinoSwitch`, `_RenderSlider`[/-][+]`TapGestureRecognizer` leaked by `_RenderCupertinoSwitch`, `_RenderSlider`[/+]on Apr 17, 2023
changed the title [-]`TapGestureRecognizer` leaked by `_RenderCupertinoSwitch`, `_RenderSlider`[/-][+]`TapGestureRecognizer` leaked by `_RenderSlider` and `_RenderRangeSlider`[/+]on Apr 18, 2023
Activity
[-]TapGestureRecognizer is not disposed in framework[/-][+]TapGestureRecognizer leaked by RenderToggleable, _RenderCupertinoSwitch, _RenderSlider[/+]Hixie commentedon Jan 22, 2018
Sounds like a bug.
cbracken commentedon Sep 19, 2018
/cc @xster @HansMuller
tvolkert commentedon Jan 13, 2020
@goderbauer
goderbauer commentedon Jan 13, 2020
Problem is still present, we should fix it by creating the Recognizers on attach and disposing them on detach, similarly to how we fixed this for RenderEditable in #42076.
goderbauer commentedon Feb 24, 2020
Instead of what I am suggestion above, we should do what's suggested in #49999 (comment) to address this problem.
1 remaining item
goderbauer commentedon Feb 19, 2021
Not disposing these recognizers is actually causing crashes in the RenderToggleable. I've filed #76411 with details.
exaby73 commentedon Apr 17, 2023
#76745 removed
RenderToggleablebut_RenderCupertinoSwitchand_RenderSliderstill do not dispose of theirTapGestureRecognizers. Updating the labels and removingRenderToggleablefrom the title to better reflect the current state of the issue._RenderCupertinoSwitchflutter/packages/flutter/lib/src/cupertino/switch.dart
Lines 664 to 667 in 858d4ff
_RenderSliderflutter/packages/flutter/lib/src/cupertino/switch.dart
Lines 664 to 667 in 858d4ff
[-]TapGestureRecognizer leaked by RenderToggleable, _RenderCupertinoSwitch, _RenderSlider[/-][+]TapGestureRecognizer leaked by `_RenderCupertinoSwitch`, `_RenderSlider`[/+][-]TapGestureRecognizer leaked by `_RenderCupertinoSwitch`, `_RenderSlider`[/-][+]`TapGestureRecognizer` leaked by `_RenderCupertinoSwitch`, `_RenderSlider`[/+][-]`TapGestureRecognizer` leaked by `_RenderCupertinoSwitch`, `_RenderSlider`[/-][+]`TapGestureRecognizer` leaked by `_RenderSlider` and `_RenderRangeSlider`[/+]bleroux commentedon Apr 18, 2023
In #51606 the
CupertinoSwitchwas refactored to move the gesture recognizer out of theRenderObjectinto a state object._RenderSliderand_RenderRangeSliderdo not dispose theirTapGestureRecognizer.AbdeMohlbi commentedon Nov 12, 2026
this seems to be fixed now because both
_RenderRangeSliderand_RenderSliderdo dispose theirTapGestureRecognizer:_RenderRangeSlider
flutter/packages/flutter/lib/src/material/range_slider.dart
Lines 1291 to 1294 in 42cd7ee
_RenderSlider
flutter/packages/flutter/lib/src/material/slider.dart
Lines 1548 to 1552 in 42cd7ee