Skip to content

Unmount everything and dispose States when host activity dies  #19358

@xster

Description

@xster

Looking at #19159, it seems reasonable looking at the API doc to expect the State.dispose to be called when the FlutterActivity is finishing/being destroyed. Yet it never gets called and there's an inbalance between things registered and/or created during initState() and things unregistered and/or released during dispose().

Should we:

  1. Have FlutterView also handle onDestroy() (and equivalent on iOS)
  2. Have a new AppLifecycleState for finishing
  3. Have the widget framework unmount and dispose everything on onDestroy

or at least have the State.dispose() API doc reference AppLifecycleState if we don't want to do this automatically?

cc @Hixie @jason-simmons
also cc @matthew-carroll since this scenario will surface more frequently with add-to-app

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.team-engineOwned by Engine teamtriaged-engineTriaged by Engine team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions