dispose method
void
dispose()
Stops all recorders and clears the registry. Idempotent.
Does not dispose the registered cells — the harness does not own them. The caller is responsible for any cell invalidation.
After dispose, add, recordPulses, pump, and emitAndSettle throw StateError; cell, valueCell, and cells return the (now empty) registry without throwing, since they read from it rather than extending it.
See Also:
- PulseRecorder.stop — the primitive used on each tracked recorder.
Implementation
void dispose() {
if (_disposed) return;
_disposed = true;
for (final recorder in _recorders) {
recorder.stop();
}
_recorders.clear();
_cells.clear();
}