SafePointer<T extends NativeType> constructor

SafePointer<T extends NativeType>(
  1. Pointer<T> _pointer, {
  2. void disposeFunc(
    1. Pointer<T>
    )?,
  3. String debugName = 'Unnamed',
})

Constructs a SafePointer with the given pointer and optional dispose function.

  • pointer: The pointer to manage.
  • disposeFunc: Optional function to dispose the pointer.
  • debugName: Optional name for debugging purposes.

Implementation

SafePointer(
  this._pointer, {
  void Function(Pointer<T>)? disposeFunc,
  String debugName = 'Unnamed',
})  : _disposeFunc = disposeFunc,
      _debugName = debugName;