deactivate method

void deactivate([
  1. Object? thrown
])
inherited

A public interface for object deactivation.

If the state is Active, the deactivate method calls dispose and sets the state to Deactivated. If deactivate is called during the handling of a thrown Object, such as an Exception, the thrown object should be passed to deactivate as an argument.

Implementation

void deactivate([Object? thrown]) {
  if (isActive())
    try {
      dispose(thrown);
    } finally {
      if (isActive()) ////
        setDeactivated();
    }
}