getOriginalPointerAndDispose method

  1. @nonVirtual
Pointer<C> getOriginalPointerAndDispose()

Returns originalPointer and immediately calls markDisposed.

The canonical way to hand the pointer back to C and unload. Gets the pointer, then ensures this instance can no longer be used.

Implementation

@nonVirtual
Pointer<C> getOriginalPointerAndDispose() {
  final pointer = getOriginalPointer();
  markDisposed();
  return pointer;
}