DisposeWithFinalizer method
void
DisposeWithFinalizer(
- bool suppressFinalizer
)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Value indicating whether to suppress the garbage collector's finalizer..
Implementation
/* private */
void DisposeWithFinalizer(bool suppressFinalizer) {
// GC.SuppressFinalize has no Dart equivalent (there is no finalizer).
// C# takes lockObject here; Dispose is synchronous and Dart runs it
// without interleaving, so the state is updated atomically anyway.
if (!_isDisposed) {
if (_currentHangingRequest != null) {
_currentHangingRequest = null;
}
// C# sets subscriptions and session to null.
_subscriptions.clear();
_isDisposed = true;
}
}