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 fynngodau committed Jul 8, 2023
1 parent 1d2ae42 commit 7c58c6b
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 7c58c6b

Please sign in to comment.