Fix use after free

This commit is contained in:
Kai Tamkun
2024-11-01 16:55:07 -07:00
parent dffc718b6a
commit 8bb8193a39

View File

@@ -1067,8 +1067,6 @@ extern "C" napi_status napi_remove_wrap(napi_env env, napi_value js_object,
}
external->m_value = nullptr;
ref->finalizer = Bun::NapiFinalizer {};
globalObject->napiWraps()->remove(value.asCell());
// don't delete the ref: if weak, it'll delete itself when the JS object is deleted;