Skip to content

_DraggableScrollableSheetState does not dispose extent. #133705

Closed

Description

@polina-c

PR that marks the leak: #133693

Steps to repro:

  1. Remove notDisposedAllowList added by the PR
  2. Run the updated test library with 'flutter run '
  3. Observe the test failure

I tried to invoke _extent.dispose() in dispose, but it caused some tests failing:

06:50 +8815 ~22: /b/s/w/ir/x/w/flutter/packages/flutter/test/material/scaffold_test.dart: Floating action button shrinks when bottom sheet becomes dominant                                            
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
The following assertion was thrown while finalizing the widget tree:
A ValueNotifier<double> was used after being disposed.
Once you have called dispose() on a ValueNotifier<double>, it can no longer be used.

When the exception was thrown, this was the stack:
#0      ChangeNotifier.debugAssertNotDisposed.<anonymous closure> (package:flutter/src/foundation/change_notifier.dart:179:9)
#1      ChangeNotifier.debugAssertNotDisposed (package:flutter/src/foundation/change_notifier.dart:186:6)
#2      ChangeNotifier.dispose (package:flutter/src/foundation/change_notifier.dart:375:27)
#3      _DraggableSheetExtent.dispose (package:flutter/src/widgets/draggable_scrollable_sheet.dart:609:18)
#4      _DraggableScrollableSheetState.dispose (package:flutter/src/widgets/draggable_scrollable_sheet.dart:723:13)
#5      StatefulElement.unmount (package:flutter/src/widgets/framework.dart:5669:11)
#6      _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:2056:13)
#7      _InactiveElements._unmount.<anonymous closure> (package:flutter/src/widgets/framework.dart:2054:7)
#8      ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:5512:14)

Activity

  1. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    and removed
    in triagePresently being triaged by the triage team
    on Aug 31, 2023
  2. polina-c commented on Sep 1, 2023

    @polina-c
    ContributorAuthor

    @goderbauer , can you please help to triage this?

  3. added
    a: leak trackingIssues and PRs related to memory leaks detected by leak_tracker
    on Sep 21, 2023
  4. github-actions commented on Oct 5, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: leak trackingIssues and PRs related to memory leaks detected by leak_trackerframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions