mirror of
https://gitee.com/openharmony/telephony_core_service
synced 2024-11-23 08:00:07 +00:00
!2453 异常返回前释放资源
Merge pull request !2453 from hanxuejian/peronal/hxj/delctx
This commit is contained in:
commit
d83eb6b6ba
@ -158,6 +158,8 @@ napi_value NapiCreateAsyncWork3(const AsyncPara ¶, AsyncContextType *asyncCo
|
|||||||
if (errCode.has_value()) {
|
if (errCode.has_value()) {
|
||||||
JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value());
|
JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value());
|
||||||
NapiUtil::ThrowError(env, error.errorCode, error.errorMessage);
|
NapiUtil::ThrowError(env, error.errorCode, error.errorMessage);
|
||||||
|
delete asyncContext;
|
||||||
|
asyncContext = nullptr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,6 +167,8 @@ napi_value NapiCreateAsyncWork3(const AsyncPara ¶, AsyncContextType *asyncCo
|
|||||||
if (errCode.has_value()) {
|
if (errCode.has_value()) {
|
||||||
JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value());
|
JsError error = NapiUtil::ConverErrorMessageForJs(errCode.value());
|
||||||
NapiUtil::ThrowError(env, error.errorCode, error.errorMessage);
|
NapiUtil::ThrowError(env, error.errorCode, error.errorMessage);
|
||||||
|
delete asyncContext;
|
||||||
|
asyncContext = nullptr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user