Closed splangi closed 5 years ago
I'm going to close this myself, because in fact my issue still persists and the IntentReceiver is leaked. Im using the plugin in a background isolate (aka a background FlutterNativeView) and there the broadcast receiver is leaked despite me calling FlutterNativeView.destroy() in Service.onDestroy().
:sparkles: Bug Fix
:arrow_heading_down: Currently, when the FlutterNativeView is destroyed and there is a registration to the LocationManagerMODE_CHANGED_ACTION broadcast receiver, then the broadcast receiver is leaked (a warning is printed as well to the logs by Android system)
:new: What is the new behavior (if this is a feature change)?
A PluginRegistry.ViewDestroyListener is implemented and registered. If the FlutterNativeView is destroyed, then the broadcast receiver is unregistered.
:boom: Does this PR introduce a breaking change?
No.
:bug: Recommendations for testing
This is Android only change. Try situations where the FlutterNativeView is destroyed and a listener attached to the serviceStatus stream. This is my first Pull request ever, so I would advise extra caution.
:memo: Links to relevant issues/docs
Did not create an issue, but should have done.
:thinking: Checklist before submitting