[6.7.0][地图] refactor: 修复 地图内存泄露 问题;

This commit is contained in:
aibingbing
2024-10-28 19:27:18 +08:00
parent 30a1009faf
commit ba24ee88d6

View File

@@ -11,6 +11,7 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationWGS84Liste
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisStatesListener
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerChassisStatesListenerManager
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.map.MogoMap
import com.mogo.map.MogoMapView
import com.mogo.map.overlay.line.Polyline
@@ -137,6 +138,10 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
// 先取消注册数据再onDestroy
CallerChassisLocationWGS84ListenerManager.removeListener(TAG)
CallerChassisStatesListenerManager.removeListener(TAG)
CallerMapUIServiceManager.getOverlayManager()?.let {
it.removeAllLines()
it.removeAllPoints()
}
super.onDestroy()
}