ffi_dlclose#
Release a library handle previously returned by dlopen.
Synopsis#
Peta::FFI::dlclose($lib);
What you get back#
Always 1. The return value exists so the call composes cleanly
in expressions; inspecting it tells you nothing about success.
Edge cases#
No argument — croaks with
Peta::FFI::dlclose: requires library handle.Zero or null handle — silently ignored. Passing
0is safe and commonly used as an “already closed” sentinel.Double close — passing a handle that has already been released is undefined behaviour at the
dlcloselevel; keep a single owner per handle or null out your copy after closing.Outstanding calls — closing a library while a pointer or string it returned is still in use is undefined behaviour. Copy everything you need out of the library first.