提交 47bf00f9 编写于 作者: H huangzhenghua

fixed 0e9c66d9 from https://gitee.com/huanghello/xts_acts/pulls/9156

fix memleak of testcase

issue: https://gitee.com/openharmony/xts_acts/issues/I7H5S9Signed-off-by: Nhuangzhenghua <huangzhenghua3@huawei.com>
Change-Id: I262f92cd458068c52ed30bed69092f4aa5ab94ed
上级 afbebf6d
......@@ -1997,12 +1997,9 @@ static napi_value napiCancelAsyncWork(napi_env env, napi_callback_info info)
napi_value resourceName = nullptr;
napi_create_string_utf8(env, "AsyncWorkTest", NAPI_AUTO_LENGTH, &resourceName);
napi_create_async_work(env, nullptr, resourceName, [](napi_env value, void* data) {},
[](napi_env env, napi_status status, void* data) {
napi_async_work workData = (napi_async_work)data;
napi_delete_async_work(env, workData);
}, work, &work);
napi_queue_async_work(env, work);
[](napi_env env, napi_status status, void* data) {}, nullptr, &work);
NAPI_CALL(env, napi_cancel_async_work(env, work));
napi_delete_async_work(env, work);
napi_value value;
NAPI_CALL(env, napi_create_int32(env, 0, &value));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册