dispose method

void dispose()

Releases the underlying native resources. Idempotent: calling it more than once is safe, but the object must not be used after dispose.

Implementation

void dispose() {
  if (_disposed) return;
  _disposed = true;
  freeNative();
}