5 .Nd close a dynamic library or bundle
9 .Fn dlclose "void* handle"
12 releases a reference to the dynamic library or bundle referenced by
14 If the reference count drops to 0, the bundle is removed from the
18 Just before removing a dynamic library or bundle in this way, any
19 termination routines in it are called.
21 is the value returned by a previous call to dlopen.
23 Prior to Mac OS X 10.5, only bundles could be unloaded. Starting in Mac OS X 10.5,
24 dynamic libraries may also be unloaded. There are a couple of cases in which a
25 dynamic library will never be unloaded: 1) the main executable links against it,
26 2) an API that does not support unloading (e.g. NSAddImage()) was used to load
27 it or some other dynamic library that depends on it, 3) the dynamic library
28 is in dyld's shared cache.
32 is successful, it returns a value of 0.
33 Otherwise it returns -1, and sets an error string that can be