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

fixed issue with map disposal on web #895

Merged
merged 1 commit into from
Feb 4, 2022
Merged

Conversation

felix-ht
Copy link
Collaborator

@felix-ht felix-ht commented Feb 4, 2022

Sometimes after a map has been disposed by the framework, one of two things would happen:

  • a callback (e.g. cameraMoved) was called after the controller has been disposed - causing an error as it tried to notifyListeners after a disposal.

  • the map would try to redraw after the canvas had been disposed - this would fully crash the web app.

To fix this i removed all callback from within the controller on disposal (this should also allow the GC to collect it) and the web platform plugin now also properly releases all resources avoiding redraws.

@felix-ht felix-ht temporarily deployed to ANDROID_CI_DOWNLOADS_TOKEN February 4, 2022 10:51 Inactive
@felix-ht felix-ht had a problem deploying to ANDROID_CI_DOWNLOADS_TOKEN February 4, 2022 10:51 Failure
@felix-ht
Copy link
Collaborator Author

felix-ht commented Feb 4, 2022

this should also fix #639

Copy link
Contributor

@AAverin AAverin left a comment

Choose a reason for hiding this comment

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

I don't run my app in the web so couldn't test.
Looks good, similar to what I had in my PRs that were fixing leaks, but probably wasn't that necessary for native.

@felix-ht
Copy link
Collaborator Author

felix-ht commented Feb 4, 2022

@AAverin yeah thats why i added you as well. And thanks for the review!

@felix-ht felix-ht merged commit 1b61a9c into master Feb 4, 2022
@felix-ht felix-ht deleted the fix-web-map-disposal-issues branch February 4, 2022 11:07
@felix-ht
Copy link
Collaborator Author

felix-ht commented Feb 4, 2022

note that the android build failed. This is however not related to this pr and almost certainly caused by the release of flutter 2.10. So i went forward with the merge.
This should be addressed in a future PR

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.

2 participants