diff --git a/utils/filemgmt_libn/src/n_async/n_async_work_callback.cpp b/utils/filemgmt_libn/src/n_async/n_async_work_callback.cpp index 9cad32c850d274ac7fcb7dfee9a9bcfa2141d77c..4f2e88a80ff631e5d08e328337710a53c6a5783e 100644 --- a/utils/filemgmt_libn/src/n_async/n_async_work_callback.cpp +++ b/utils/filemgmt_libn/src/n_async/n_async_work_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -120,6 +120,7 @@ static void CallbackComplete(napi_env env, napi_status status, void *data) napi_value callback = ctx->cb_.Deref(env).val_; if (!bool(ctx->cb_)) { HILOGE("failed to get ref."); + napi_close_handle_scope(env, scope); return; }