[fix]
[内存泄漏检测]
This commit is contained in:
yangyakun
2024-10-28 17:12:52 +08:00
parent 417990b24d
commit 58b15deea0
3 changed files with 18 additions and 36 deletions

View File

@@ -74,6 +74,7 @@ class AutopilotState @JvmOverloads constructor(
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
autopilotStateAnimator?.release()
}

View File

@@ -50,23 +50,21 @@ class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>() {
context?.let {
if(ProjectUtils.isSaas()&& AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)){
CallerEagleBaseFunctionCall4OchManager.addSingleToolKitDefaultItem(runningTaskGateWay,"本地缓存任务", R.drawable.bus_running_task_history,4)
}
CallerEagleBaseFunctionCall4OchManager.addToolKitDefaultItemClickListener(runningTaskGateWay,object :
IToolKitItemClickListener{
override fun onItemClick(toolTag: String, ctx: Context?) {
when (toolTag) {
runningTaskGateWay -> {
d(TAG, "runningTaskGateWay:$runningTaskGateWay---toolTag:$toolTag")
RunningTaskManager.showBadCaseConfigWindow(it)
CallerEagleBaseFunctionCall4OchManager.addToolKitDefaultItemClickListener(runningTaskGateWay,object :
IToolKitItemClickListener{
override fun onItemClick(toolTag: String, ctx: Context?) {
when (toolTag) {
runningTaskGateWay -> {
d(TAG, "runningTaskGateWay:$runningTaskGateWay---toolTag:$toolTag")
RunningTaskManager.showBadCaseConfigWindow(it)
}
}
}
}
})
CallerEagleBaseFunctionCall4OchManager.addSingleToolKitCustomItem(lineView, LineView(it),10)
})
CallerEagleBaseFunctionCall4OchManager.addSingleToolKitCustomItem(lineView, LineView(it),10)
}
}
initListener()
}
override fun initViews(savedInstanceState: Bundle?) {
@@ -87,7 +85,6 @@ class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>() {
inflater: LayoutInflater, container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
EventBus.getDefault().register(this)
return super.onCreateView(inflater, container, savedInstanceState)
}
@@ -111,35 +108,17 @@ class ShuttleFragment : MvpFragment<ShuttleFragment?, BusPresenter?>() {
if (mPresenter != null) {
mPresenter!!.onDestroy(this)
}
if(ProjectUtils.isSaas()&& AppIdentityModeUtils.isShuttle(FunctionBuildConfig.appIdentityMode)) {
CallerEagleBaseFunctionCall4OchManager.removeToolkitByTag(mutableListOf(lineView))
CallerEagleBaseFunctionCall4OchManager.removeToolKitDefaultItemClickListener(lineView)
}
super.onDestroyView()
CallerAutopilotRecordListenerManager.removeListener(TAG)
EventBus.getDefault().unregister(this)
}
private fun initListener() {
}
override fun onDestroy() {
super.onDestroy()
}
@Subscribe(threadMode = ThreadMode.MAIN)
fun changeOverview(eventLogout: EventLogout) {
when (eventLogout.messgae) {
EventLogout.SHOW_QR_TYPE-> { //显示二维码
}
EventLogout.SHOW_WAIT_UPLOAD_TASK-> {
context?.let {
RunningTaskManager.showBadCaseConfigWindow(it)
}
}
else -> {}
}
}
/**
* END
*/

View File

@@ -186,6 +186,8 @@ class TaxiFragment :MvpFragment<TaxiFragment?, TaxiPresenter?>(),
it.removeAllLines()
it.removeAllPoints()
}
CallerEagleBaseFunctionCall4OchManager.removeToolkitByTag(mutableListOf(lineView))
CallerEagleBaseFunctionCall4OchManager.removeToolKitDefaultItemClickListener(lineView)
startAutopilotAnimationView.cancelCountdown()
super.onDestroyView()
}