Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release PluginBinding instance when activity is detached. #1264

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

mvanbeusekom
Copy link
Member

The plugin keeps hold of the PluginBinding instance once an Activity is attached, but never releases the instance when the Activity is detached from the plugin. This will cause the Activity to be leaked (as described in issue #1256). This PR will release the PluginBinding instance when the onDetachedFromActivity method is called, making sure the handle to the Activity is released, which prevents leaking the Activity.

Fixes #1259

Pre-launch Checklist

  • I made sure the project builds.
  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is does not need version changes.
  • I updated CHANGELOG.md to add a description of the change.
  • I updated/added relevant documentation (doc comments with ///).
  • I rebased onto main.
  • I added new tests to check the change I am making, or this PR does not need tests.
  • I made sure all existing and new tests are passing.
  • I ran dart format . and committed any changes.
  • I ran flutter analyze and fixed any errors.

Copy link
Contributor

@TimHoogstrate TimHoogstrate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mvanbeusekom mvanbeusekom merged commit bb8e40a into main Jan 16, 2024
1 check passed
@mvanbeusekom mvanbeusekom deleted the issue/1256 branch January 16, 2024 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Can't launch app
2 participants