ObjectPostDestructionChecker constructor

ObjectPostDestructionChecker(
  1. Object object,
  2. void onPostDestruction()
)

Creates an ObjectPostDestructionChecker instance.

This constructor attaches a post-destruction callback to the specified object.

  • object The object to which the post-destruction callback will be attached.
  • onPostDestruction The callback function to be executed after the object is destructed.

Implementation

ObjectPostDestructionChecker(
  Object object,
  void Function() onPostDestruction,
) {
  _finalizer.attach(
    object,
    onPostDestruction,
    detach: object,
  );
}