JSObjectFinalizeCallback

Type Alias JSObjectFinalizeCallback 

Source
pub type JSObjectFinalizeCallback = Option<unsafe extern "C-unwind" fn(JSObjectRef)>;
Available on crate features JSBase and JSObjectRef only.
Expand description

The callback invoked when an object is finalized (prepared for garbage collection). An object may be finalized on any thread.

Parameter object: The JSObject being finalized.

If you named your function Finalize, you would declare it like this:

void Finalize(JSObjectRef object);

The finalize callback is called on the most derived class first, and the least derived class (the parent class) last.

You must not call any function that may cause a garbage collection or an allocation of a garbage collected object from within a JSObjectFinalizeCallback. This includes all functions that have a JSContextRef parameter.

See also Apple’s documentation

Aliased Type§

pub enum JSObjectFinalizeCallback {
    None,
    Some(unsafe extern "C-unwind" fn(*mut OpaqueJSValue)),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C-unwind" fn(*mut OpaqueJSValue))

Some value of type T.