Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[android] Clear out mapCallback's OnMapReadyCallbacks on onDestroy #9874

Closed
wants to merge 1 commit into from
Closed

[android] Clear out mapCallback's OnMapReadyCallbacks on onDestroy #9874

wants to merge 1 commit into from

Conversation

robindarby
Copy link
Contributor

@robindarby robindarby commented Aug 28, 2017

There is a state where MapView's OnMapChangedListener.onMapReadyCallbackList.onMapReady() callbacks are called, but member destroyed == true (i.e. onDestroy() has been called).

This can cause any callback provided to getMapAsync to be executed even though the MapView is in a destroyed state!

The following patch calls clear() on the list of callbacks, preventing code execution in OnMapChangedListener.onMapReady() .

@kkaefer kkaefer added the Android Mapbox Maps SDK for Android label Sep 11, 2017
@tobrun
Copy link
Member

tobrun commented Sep 11, 2017

Thank you for the contribution @robindarby, to allow our CI to execute I will have to push your changes in a seperate PR. You can find that PR here.

@tobrun tobrun closed this Sep 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants