我正在使用 dlopen(NULL)
获取我的可执行文件的主模块的句柄,如下所示。
void *handle = dlopen(NULL, RTLD_NOW);
我应该调用 dlclose(handle)
来减少主模块的引用计数吗?
最佳答案
来自手册页:
dlclose()
The function dlclose() decrements the reference count on the dynamic
library handle handle. If the reference count drops to zero and no
other loaded libraries use symbols in it, then the dynamic library is
unloaded.
我敢打赌,当您将它称为“主”句柄时它是空的
关于linux - 在 dlopen(NULL) 返回的句柄上调用 dlclose,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40676660/