Skip to content

Commit

Permalink
Make sure no callbacks are called when GoogleMap is destroyed
Browse files Browse the repository at this point in the history
We faced an IllegalStateException related to a null root view of
a fragment layout.

If the GoogleMap is destroyed, there is no need to call the callbacks
related to it in an upcoming future.
  • Loading branch information
jonathanklee authored and mar-v-in committed Jul 8, 2023
1 parent bcded2c commit 99d5e09
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,7 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG
override fun onPause() = mapView?.onPause() ?: Unit
override fun onDestroy() {
Log.d(TAG, "destroy");
userOnInitializedCallbackList.clear()
lineManager?.onDestroy()
lineManager = null
fillManager?.onDestroy()
Expand Down

0 comments on commit 99d5e09

Please sign in to comment.