mirror of
https://gitee.com/openharmony/accessibility
synced 2024-11-23 06:50:30 +00:00
!1537 修复清理napI引用,导致的崩溃问题
Merge pull request !1537 from taojuncun/bug_1113_02
This commit is contained in:
commit
865510a712
@ -662,7 +662,6 @@ void NAccessibilityConfigObserverImpl::UnsubscribeObserver(napi_env env,
|
||||
for (auto iter = observers_.begin(); iter != observers_.end();) {
|
||||
if ((*iter)->configId_ == id) {
|
||||
if (CheckObserverEqual(env, observer, (*iter)->env_, (*iter)->handlerRef_)) {
|
||||
napi_delete_reference((*iter)->env_, (*iter)->handlerRef_);
|
||||
observers_.erase(iter);
|
||||
return;
|
||||
} else {
|
||||
@ -680,7 +679,6 @@ void NAccessibilityConfigObserverImpl::UnsubscribeObservers(OHOS::AccessibilityC
|
||||
std::lock_guard<ffrt::mutex> lock(mutex_);
|
||||
for (auto iter = observers_.begin(); iter != observers_.end();) {
|
||||
if ((*iter)->configId_ == id) {
|
||||
napi_delete_reference((*iter)->env_, (*iter)->handlerRef_);
|
||||
iter = observers_.erase(iter);
|
||||
} else {
|
||||
iter++;
|
||||
|
Loading…
Reference in New Issue
Block a user