fix(napi): dropping Error should not call napi-sys if feature is set to noop (#1477)
This commit is contained in:
parent
c70c76d8f3
commit
31015652b8
1 changed files with 10 additions and 7 deletions
|
@ -162,6 +162,8 @@ impl From<std::io::Error> for Error {
|
|||
|
||||
impl Drop for Error {
|
||||
fn drop(&mut self) {
|
||||
#[cfg(not(feature = "noop"))]
|
||||
{
|
||||
if !self.maybe_env.is_null() && !self.maybe_raw.is_null() {
|
||||
let delete_reference_status =
|
||||
unsafe { sys::napi_delete_reference(self.maybe_env, self.maybe_raw) };
|
||||
|
@ -172,6 +174,7 @@ impl Drop for Error {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ExtendedErrorInfo {
|
||||
|
|
Loading…
Reference in a new issue