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

Memory leak in plugins? #1055

Closed
kroikie opened this issue Oct 13, 2019 · 1 comment
Closed

Memory leak in plugins? #1055

kroikie opened this issue Oct 13, 2019 · 1 comment

Comments

@kroikie
Copy link
Collaborator

kroikie commented Oct 13, 2019

So, I may be wrong, but in the plugins below it looks like that registration in the ActivityLifecycleCallbacks and in the LocalBroadcastManager may become memory leaks in case the Flutter Activity is open multiple times.
For instance, when flutter is being used in add-to-app to show a product detail. Every time that Activity is open the plugin registration process is triggered and a new listener is attached, but it is never released.

https://github.com/flutter/plugins/blob/master/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FirebaseMessagingPlugin.java#L58

https://github.com/flutter/plugins/blob/master/packages/image_picker/android/src/main/java/io/flutter/plugins/imagepicker/ImagePickerPlugin.java#L95

https://github.com/flutter/plugins/blob/master/packages/google_maps_flutter/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapsPlugin.java#L36

I have some ideas of how to avoid those calls, but I would like to confirm this before trying to change the code.

@iapicca
Copy link

iapicca commented Oct 22, 2019

#53
#766
#829
#508

@firebase firebase locked and limited conversation to collaborators Aug 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants