nativeFree property

  1. @override
Pointer<NativeFinalizerFunction> get nativeFree
override

A pointer to the native free function used by this allocator.

Pass this to a NativeFinalizer to ensure memory is released automatically if the owning Dart object is garbage collected before free is called. This acts as a safety net against leaks when explicit disposal is not guaranteed.

Implementation

@override
Pointer<NativeFinalizerFunction> get nativeFree =>
    Platform.isWindows ? coTaskMemFreeAddress : posixFreeAddress;