Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(neon): Close scopes in release builds #952

Merged
merged 1 commit into from
Jan 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(neon): Close scopes in release builds
  • Loading branch information
kjvalencik committed Jan 3, 2023
commit 09421ef1cb77fa207aaf58f9fca1663ef3744a83
14 changes: 6 additions & 8 deletions crates/neon/src/sys/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ impl HandleScope {
impl Drop for HandleScope {
fn drop(&mut self) {
unsafe {
debug_assert_eq!(
napi::close_handle_scope(self.env, self.scope),
napi::Status::Ok,
);
let _status = napi::close_handle_scope(self.env, self.scope);

debug_assert_eq!(_status, napi::Status::Ok,);
}
}
}
Expand Down Expand Up @@ -72,10 +71,9 @@ impl EscapableHandleScope {
impl Drop for EscapableHandleScope {
fn drop(&mut self) {
unsafe {
debug_assert_eq!(
napi::close_escapable_handle_scope(self.env, self.scope),
napi::Status::Ok,
);
let _status = napi::close_escapable_handle_scope(self.env, self.scope);

debug_assert_eq!(_status, napi::Status::Ok,);
}
}
}
Expand Down