mirror of
https://gitee.com/openharmony/applications_settings
synced 2024-11-26 16:10:49 +00:00
commit
49eabb7bc1
@ -45,15 +45,6 @@ namespace Settings {
|
||||
this->cbInfo = nullptr;
|
||||
}
|
||||
|
||||
void SettingsObserver::EnvObserver(void* arg)
|
||||
{
|
||||
AsyncCallbackInfo* callBackInfo = reinterpret_cast<AsyncCallbackInfo*>(arg);
|
||||
if (callBackInfo == nullptr || callBackInfo->env == nullptr) {
|
||||
return;
|
||||
}
|
||||
callBackInfo->env = nullptr;
|
||||
}
|
||||
|
||||
int OnChangeAsync(uv_loop_s* loop, uv_work_t *work)
|
||||
{
|
||||
int ret = uv_queue_work(loop, work, [](uv_work_t *work) {},
|
||||
@ -88,8 +79,6 @@ namespace Settings {
|
||||
&callResult);
|
||||
napi_close_handle_scope(settingsObserver->cbInfo->env, scope);
|
||||
SETTING_LOG_INFO("%{public}s, uv_work success.", __func__);
|
||||
napi_remove_env_cleanup_hook(settingsObserver->cbInfo->env, SettingsObserver::EnvObserver,
|
||||
settingsObserver->cbInfo);
|
||||
delete work;
|
||||
});
|
||||
return ret;
|
||||
@ -113,7 +102,6 @@ namespace Settings {
|
||||
SETTING_LOG_ERROR("%{public}s, fail to get uv work.", __func__);
|
||||
return;
|
||||
}
|
||||
napi_add_env_cleanup_hook(cbInfo->env, SettingsObserver::EnvObserver, this);
|
||||
work->data = reinterpret_cast<void*>(this);
|
||||
|
||||
int ret = OnChangeAsync(loop, work);
|
||||
|
Loading…
Reference in New Issue
Block a user