diff --git a/crates/napi/src/js_values/object.rs b/crates/napi/src/js_values/object.rs index 20acd658..77507f00 100644 --- a/crates/napi/src/js_values/object.rs +++ b/crates/napi/src/js_values/object.rs @@ -37,7 +37,7 @@ impl JsObject { where T: 'static, Hint: 'static, - F: FnOnce(FinalizeContext), + F: FnOnce(FinalizeContext) + 'static, { let mut maybe_ref = ptr::null_mut(); let wrap_context = Box::leak(Box::new((native, finalize_cb, ptr::null_mut())));