fix(napi): require static lifetime on add_finalizer callback (#1968)
Co-authored-by: LongYinan <lynweklm@gmail.com>
This commit is contained in:
parent
5b5f616d81
commit
ebd5eef267
1 changed files with 1 additions and 1 deletions
|
@ -37,7 +37,7 @@ impl JsObject {
|
||||||
where
|
where
|
||||||
T: 'static,
|
T: 'static,
|
||||||
Hint: 'static,
|
Hint: 'static,
|
||||||
F: FnOnce(FinalizeContext<T, Hint>),
|
F: FnOnce(FinalizeContext<T, Hint>) + 'static,
|
||||||
{
|
{
|
||||||
let mut maybe_ref = ptr::null_mut();
|
let mut maybe_ref = ptr::null_mut();
|
||||||
let wrap_context = Box::leak(Box::new((native, finalize_cb, ptr::null_mut())));
|
let wrap_context = Box::leak(Box::new((native, finalize_cb, ptr::null_mut())));
|
||||||
|
|
Loading…
Reference in a new issue