When profiling, tools such as valgrind --tool=callgrind require that the
dynamically loaded libraries are not dlclosed so they can collect usage
information.
The public ErasureCodePluginRegistry::disable_dlclose boolean is introduced
for this purpose.
Signed-off-by: Loic Dachary <loic@dachary.org>
ErasureCodePluginRegistry::ErasureCodePluginRegistry() :
lock("ErasureCodePluginRegistry::lock"),
- loading(false)
+ loading(false),
+ disable_dlclose(false)
{
}
ErasureCodePluginRegistry::~ErasureCodePluginRegistry()
{
+ if (disable_dlclose)
+ return;
+
for (std::map<std::string,ErasureCodePlugin*>::iterator i = plugins.begin();
i != plugins.end();
++i) {
public:
Mutex lock;
bool loading;
+ bool disable_dlclose;
std::map<std::string,ErasureCodePlugin*> plugins;
static ErasureCodePluginRegistry singleton;