detachFromJoltAttachments static method
Detaches a disposer from a Jolt object.
Parameters:
target: The object to detach the disposer fromdisposer: The cleanup function to remove
This method removes the disposer from the target object's attachment list. The disposer will no longer be executed when the object is disposed.
Example:
final cancel = JFinalizer.attachToJoltAttachments(signal, disposer);
// Later:
JFinalizer.detachFromJoltAttachments(signal, disposer);
// Or simply:
cancel();
Implementation
static void detachFromJoltAttachments(Object target, Disposer disposer) {
final disposers = joltAttachments[target];
if (disposers != null) {
disposers.remove(disposer);
}
}