-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
The general model on iOS (I believe; it's possible the internals have changed here enough since I last looked that this is no longer true and there is enough indirection that I can't quickly tell from the source) is that the engine indirectly owns plugin instances via addMethodCallDelegate: (which despite the name, creates a strong reference to the delegate, which is the plugin itself).
This makes having the FlutterTextureRegistry returned by [registrar textures] be the engine itself problematic, because if the plugin retains the texture registrar there's a cycle. It's easy for developers to do this, and it's not even clear from the API that they shouldn't.
See #102966 for an example.
We should have a proxy object with a weak reference back to the engine serve as the texture registry object that is returned instead.
/cc @gaaclarke; IIRC you fixed this same problem with the binary messenger a while ago.