dispose method

Future<void> dispose()

Disposes this YOLO instance and releases all resources

Implementation

Future<void> dispose() async {
  try {
    await _channel.invokeMethod('disposeInstance', {
      'instanceId': _instanceId,
    });
  } catch (e) {
    logInfo('Error disposing instance $_instanceId: $e');
  } finally {
    // Always remove from manager, even if platform call fails
    YOLOInstanceManager.unregisterInstance(_instanceId);
    _isInitialized = false;
  }
}