checkObjectDisposed static method

  1. @protected
  2. @visibleForTesting
bool checkObjectDisposed(
  1. Disposable disposable, [
  2. String? methodName
])

It throws DisposedException if disposable was disposed.

DisposedException will be with methodName if it is not null.

Implementation

@protected
@visibleForTesting
static bool checkObjectDisposed(Disposable disposable, [String? methodName]) {
  if (_disposedObjects[disposable] ?? false) {
    throw DisposedException(describeIdentity(disposable), methodName);
  }
  return true;
}