Function script::dom::bindings::import::module::jsapi::ShutdownAsyncTasks

source ยท
pub unsafe extern "C" fn ShutdownAsyncTasks(cx: *mut JSContext)
Expand description

When a JSRuntime is destroyed it implicitly cancels all async tasks in progress, releasing any roots held by the task. However, this is not soon enough for cycle collection, which needs to have roots dropped earlier so that the cycle collector can transitively remove roots for a future GC. For these and other cases, the set of pending async tasks can be canceled with this call earlier than JSRuntime destruction.