runCleanupFunctions function
Run all registered cleanup functions.
Implementation
Future<void> runCleanupFunctions() async {
for (final fn in _cleanupFunctions) {
try {
await fn();
} catch (_) {
// Silently ignore cleanup errors.
}
}
}