modify two files at 7/21 09:57

Signed-off-by: zhaolinglan <zhaolinglan@huawei.com>
This commit is contained in:
zhaolinglan
2022-07-21 09:57:52 +08:00
parent bc1daf879c
commit 33dcbbae4c
2 changed files with 16 additions and 2 deletions
@@ -64,10 +64,18 @@ namespace MiscServices {
// should do type check
std::lock_guard<std::recursive_mutex> lk(mapMutex);
if (jsCbMap_.empty() || jsCbMap_.find(type) == jsCbMap_.end()) {
IMSA_HILOGI("methodName %{public}s not registerted!", type.c_str());
IMSA_HILOGI("methodName %{public}s not registered!", type.c_str());
return;
}
jsCbMap_.erase(type);
for (auto it = jsCbMap_[type].begin(); it != jsCbMap_[type].end();) {
if (value->StrictEquals((*it)->Get())) {
jsCbMap_[type].erase(it);
break;
}
}
if (jsCbMap_[type].empty()) {
jsCbMap_.erase(type);
}
}
bool JsInputMethodEngineListener::IfCallbackRegistered(std::string type, NativeValue* jsListenerObject)