Dispose widgets to stop leaks. (#108193)
This commit is contained in:
committed by
GitHub
parent
dc13fd56a1
commit
e05ae3cac7
@@ -847,6 +847,7 @@ class _InkResponseState extends State<_InkResponseStateWidget>
|
||||
void dispose() {
|
||||
FocusManager.instance.removeHighlightModeListener(handleFocusHighlightModeChange);
|
||||
statesController.removeListener(handleStatesControllerChange);
|
||||
internalStatesController?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -976,6 +976,7 @@ abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
|
||||
void dispose() {
|
||||
activity?.dispose(); // it will be null if it got absorbed by another ScrollPosition
|
||||
_activity = null;
|
||||
isScrollingNotifier.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user