destroy method

Future<void> destroy()

Destroys the isolate and closes the receive port if not running on the web.

Implementation

Future<void> destroy() async {
  if (!kIsWeb) {
    _isolateManager.destroy();
  } else {
    _webWorkerManager.destroy();
  }
}