attachFinalizer method

  1. @protected
void attachFinalizer(
  1. NativeFinalizer finalizer,
  2. Pointer<Void> token, {
  3. int? externalSize,
})

Attaches this Dart object to the native pointer so that finalizer calls freeFunc on _ptr when this object is GC'd.

Implementation

@protected
void attachFinalizer(NativeFinalizer finalizer, Pointer<Void> token, {int? externalSize}) {
  finalizer.attach(this, token, detach: this, externalSize: externalSize);
}