addForeignPtrFinalizer

addForeignPtrFinalizer :: FinalizerPtr a -> ForeignPtr a -> IO ()
base Foreign.ForeignPtr
This function adds a finalizer to the given foreign object. The finalizer will run before all other finalizers for the same object which have already been registered.
addForeignPtrFinalizer :: ForeignPtr a -> IO () -> IO ()
base Foreign.Concurrent
This function adds a finalizer to the given ForeignPtr. The finalizer will run after the last reference to the foreign object is dropped, but before all previously registered finalizers for the same object.
addForeignPtrFinalizerEnv :: FinalizerEnvPtr env a -> Ptr env -> ForeignPtr a -> IO ()
base Foreign.ForeignPtr
Like addForeignPtrFinalizerEnv but allows the finalizer to be passed an additional environment parameter to be passed to the finalizer. The environment passed to the finalizer is fixed by the second argument to addForeignPtrFinalizerEnv