use destructor callback for FetchContext

This commit is contained in:
Muki Kiboigo
2025-09-08 07:07:07 -07:00
parent 9251180501
commit 20463a662b
2 changed files with 17 additions and 10 deletions

View File

@@ -2901,11 +2901,11 @@ pub fn Env(comptime State: type, comptime WebApis: type) type {
// An interface for types that want to have their jsDeinit function to be
// called when the call context ends
const DestructorCallback = struct {
pub const DestructorCallback = struct {
ptr: *anyopaque,
destructorFn: *const fn (ptr: *anyopaque) void,
fn init(ptr: anytype) DestructorCallback {
pub fn init(ptr: anytype) DestructorCallback {
const T = @TypeOf(ptr);
const ptr_info = @typeInfo(T);