Unverified Commit 9d42ad84 authored by Kostia Sokolovskyi's avatar Kostia Sokolovskyi Committed by GitHub

Fix memory leak in NestedScrollViewState. (#135248)

parent 5def6f2b
......@@ -441,6 +441,7 @@ class NestedScrollViewState extends State<NestedScrollView> {
void dispose() {
_coordinator!.dispose();
_coordinator = null;
_absorberHandle.dispose();
super.dispose();
}
......@@ -1620,6 +1621,13 @@ class _NestedOuterBallisticScrollActivity extends BallisticScrollActivity {
/// [SliverOverlapAbsorber] to align its children, and which shows sample
/// usage for this class.
class SliverOverlapAbsorberHandle extends ChangeNotifier {
/// Creates a [SliverOverlapAbsorberHandle].
SliverOverlapAbsorberHandle() {
if (kFlutterMemoryAllocationsEnabled) {
ChangeNotifier.maybeDispatchObjectCreation(this);
}
}
// Incremented when a RenderSliverOverlapAbsorber takes ownership of this
// object, decremented when it releases it. This allows us to find cases where
// the same handle is being passed to two render objects.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment