shareOrMove method

  1. @internal
PlatformPointer shareOrMove()
inherited

Increments inner reference counter and returns pointer to the underlying Rust object.

Throws a StateError if called after dispose.

Implementation

@internal
PlatformPointer shareOrMove() {
  if (!isStale()) {
    var ptr = shareFn(_ptr);
    if (_move) {
      dispose();
    }
    return ptr;
  } else {
    return FrbOpaqueBase.nullPtr();
  }
}