delete context

Change-Id: I4fbe84c5ae6baa921e20a5cbdae5086e2913fb0a
Signed-off-by: hanxuejian <hanxuejian3@huawei.com>
This commit is contained in:
hanxuejian 2024-11-14 19:32:09 +08:00
parent 26b2329b6a
commit c02e2f969d

View File

@ -158,6 +158,8 @@ napi_value NapiCreateAsyncWork3(const AsyncPara &para, AsyncContextType *asyncCo
if (errCode.has_value()) {
JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value());
NapiUtil::ThrowError(env, error.errorCode, error.errorMessage);
delete asyncContext;
asyncContext = nullptr;
return nullptr;
}
}
@ -165,6 +167,8 @@ napi_value NapiCreateAsyncWork3(const AsyncPara &para, AsyncContextType *asyncCo
if (errCode.has_value()) {
JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value());
NapiUtil::ThrowError(env, error.errorCode, error.errorMessage);
delete asyncContext;
asyncContext = nullptr;
return nullptr;
}
}