←back to thread

39 points mattrighetti | 1 comments | | HN request time: 0s | source
Show context
abstractspoon ◴[] No.45036738[source]
What if lib.B had another dependency? To deal with this dlclose would have to query every loaded module for its dependencies and then decide if lib.B could safely be unloaded.

What if lib.B had been loaded explicitly somewhere else such that it did not appear in any other module's dependency list?

replies(1): >>45075340 #
1. LegionMammal978 ◴[] No.45075340[source]
Do you mean, what if lib.B had another dependent? Every loaded library has a reference count, which counts both dependents and explicit dlopen() calls. Unless the caller is the last user (and the other conditions are satisfied), dlclose() has no effect except to decrement the reference count.