dispose method

Future<void> dispose()

Free the engine and terminate the worker isolate. The instance can be re-initialized after dispose by calling initialize again.

Implementation

Future<void> dispose() async {
  final w = _worker;
  _worker = null;
  _modelPath = null;
  await w?.dispose();
}