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) } } }