Fixing missing call to SymbolManager.onDestroy()

This commit is contained in:
Maxime NATUREL 2022-07-28 14:42:57 +02:00
parent 72e2951c3e
commit f44d8b0b20
3 changed files with 8 additions and 1 deletions

View file

@ -35,7 +35,7 @@ data class LocationSharingArgs(
@AndroidEntryPoint
class LocationSharingActivity : VectorBaseActivity<ActivityLocationSharingBinding>() {
// TODO fix leak of mapTilerView
override fun getBinding() = ActivityLocationSharingBinding.inflate(layoutInflater)
override fun initUiAndData() {

View file

@ -76,6 +76,12 @@ class MapTilerMapView @JvmOverloads constructor(
showLocationButton = typedArray.getBoolean(R.styleable.MapTilerMapView_showLocateButton, false)
}
override fun onDestroy() {
mapRefs?.symbolManager?.onDestroy()
mapRefs = null
super.onDestroy()
}
/**
* For location fragments.
*/

View file

@ -113,6 +113,7 @@ class LiveLocationMapViewFragment @Inject constructor() : VectorBaseFragment<Fra
override fun onDestroyView() {
onSymbolClickListener?.let { symbolManager?.removeClickListener(it) }
symbolManager?.onDestroy()
bottomSheetController.callback = null
views.liveLocationBottomSheetRecyclerView.cleanup()
super.onDestroyView()