killAllIsolates method
Kills all active isolates (both persistent and one-time). Useful for cleanup when you want to ensure all isolates are terminated.
Implementation
Future<void> killAllIsolates() async {
// Kill persistent isolate
await killIsolate();
// Kill all active one-time isolates
for (final isolateSession in _activeIsolateSessions.toList()) {
await isolateSession.release();
}
_activeIsolateSessions.clear();
}