From 719220cb6a60b5ed6eaf81137d57a84bce5e994e Mon Sep 17 00:00:00 2001 From: donghongyu Date: Tue, 21 Feb 2023 12:15:32 +0800 Subject: [PATCH] =?UTF-8?q?[dev=5Farch=5Fopt=5F3.0]=20[Change]=20[=201?= =?UTF-8?q?=E3=80=81=E5=A2=9E=E5=8A=A0=E5=B7=B2=E5=87=BA=E7=9B=91=E5=90=AC?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E5=B0=86Hz=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E8=AE=B0=E5=BD=95=E7=A7=BB=E9=99=A4=20]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donghongyu --- ...llerChassisLocationGCJ02ListenerManager.kt | 2 -- .../core/function/call/base/CallerBase.kt | 20 +++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ02ListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ02ListenerManager.kt index 671a05f57a..0c20a62a84 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ02ListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLocationGCJ02ListenerManager.kt @@ -35,8 +35,6 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase { return } M_LISTENERS.remove(tag) + + if (!M_LISTENERS_HZ.containsKey(tag)) { + return + } + M_LISTENERS_HZ.remove(tag) + + if (!M_LISTENERS_HZ_LAST_SEND_TIME.containsKey(tag)) { + return + } + M_LISTENERS_HZ_LAST_SEND_TIME.remove(tag) } /** @@ -83,6 +93,16 @@ open class CallerBase { M_LISTENERS.forEach { if (it.value == listener) { M_LISTENERS.remove(it.key) + + if (!M_LISTENERS_HZ.containsKey(it.key)) { + return + } + M_LISTENERS_HZ.remove(it.key) + + if (!M_LISTENERS_HZ_LAST_SEND_TIME.containsKey(it.key)) { + return + } + M_LISTENERS_HZ_LAST_SEND_TIME.remove(it.key) } } }