This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[google_maps_flutter] Overhaul lifecycle management in GoogleMapsPlugin #3213
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c977679
GoogleMapController is now uniformly driven by implementing DefaultLi…
math1man e934a18
Update CHANGELOG.md and version
math1man 9bdc386
Merge remote-tracking branch 'origin/master'
math1man 96cf26b
Fix formatting issues
math1man 62476dc
Update GoogleMapControllerTest
math1man a8e02a4
Merge remote-tracking branch 'origin/master'
math1man b920973
Remove extraneous import
math1man ea016b8
Update GoogleMapsPlugin.ProxyLifecycleProvider to use handleLifecycle…
math1man d6c9014
Merge remote-tracking branch 'origin/master'
math1man 5f479f0
Update version from 1.1.0 to 1.0.5
math1man 2c182a9
Merge remote-tracking branch 'origin/master'
math1man 039e3ce
Add javadoc for ProxyLifecycleProvider and move initial ActivityLifec…
math1man 85e592e
Merge remote-tracking branch 'origin/master'
math1man df2345d
Remove LifecycleProvider as an interface of GoogleMapsPlugin and inst…
math1man File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Remove LifecycleProvider as an interface of GoogleMapsPlugin and inst…
…ead create an anonymous inner class.
- Loading branch information
commit df2345da8d2d55e74a87524c7bb36142b43f5ca6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to keep an implicit reference to the outer class?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually keeps an explicit reference to the outer class, because
lifecycleis a field in the outer class. I don't think that's avoidable because only the plugin itself can implementActivityAware.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm probably missing something obvious... what fails if:
GoogleMapsPlugin holds a reference to the provider (an implementation with a lifecycle field) and sets the lifecycle when attached/detached to the activity, and we pass that provider reference to GoogleMapFactory, won't we avoid a reference from GoogleMapFactory to GoogleMapsPlugin in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could do that, but it doesn't really matter and ends up being more boiler plate. My assumption is that the scope of GoogleMapsPlugin is greater than the scope of GoogleMapFactory, so it doesn't matter if GoogleMapFactory transitively captures the GooglemapsPlugin instance. If that assumption is violated, all sorts of worse things happen than this particular leak.
I guess my question is what problem are you trying to solve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct, thanks for pushing back and keeping the code simple!