release addon object

Signed-off-by: sunyaozu <sunyaozu@huawei.com>
This commit is contained in:
sunyaozu 2023-06-30 11:59:02 +08:00
parent 3b06643e57
commit 963e21af8c
2 changed files with 4 additions and 2 deletions

View File

@ -96,7 +96,8 @@ void I18nAddon::Destructor(napi_env env, void *nativeObject, void *hint)
if (!nativeObject) {
return;
}
reinterpret_cast<I18nAddon *>(nativeObject)->~I18nAddon();
delete reinterpret_cast<I18nAddon *>(nativeObject);
nativeObject = nullptr;
}
napi_value I18nAddon::CreateUnicodeObject(napi_env env, napi_status &initStatus)

View File

@ -39,7 +39,8 @@ void IntlAddon::Destructor(napi_env env, void *nativeObject, void *hint)
if (!nativeObject) {
return;
}
reinterpret_cast<IntlAddon *>(nativeObject)->~IntlAddon();
delete reinterpret_cast<IntlAddon *>(nativeObject);
nativeObject = nullptr;
}
napi_value IntlAddon::SetProperty(napi_env env, napi_callback_info info)