Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

In #10863 I intermediated asset loading through an asset loader, so that individual controllers weren't using the plugin registrar directly. In doing that, I just updated the types of the ivars, but—incorrectly—not their memory models.

Registrar references are generally weak to avoid possible cycles (the registrar may internally be the same thing in the engine that owns the plugin instance), so the result was a weak reference to the new wrapper object. However, unlike the registrar, which has an externally enforced lifetime longer than the plugin, the wrapper was just an object created locally during map controller initialization, so was invalidated almost as soon as it was passed in. This fixes the controllers to keep strong references to the wrapper (which doesn't own anything, and has a weak registrar pointer, so can't create any cycles).

Fixes flutter/flutter#182149

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses a regression in custom marker icon handling on iOS. The change modifies the memory management of the assetProvider property in FLTGroundOverlaysController and FLTMarkersController from weak to strong. This ensures the asset provider is not deallocated prematurely. The PR also introduces new tests to verify the correct retention of the asset provider and updates the package version and changelog.

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 10, 2026
@auto-submit auto-submit bot merged commit 0e9252d into flutter:main Feb 10, 2026
81 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: google_maps_flutter platform-ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

google_maps_flutter_ios: 2.17.1 breaks marker icons

2 participants