Skip to content
Snippets Groups Projects
Commit 4e0b17d6 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: expose a method to clean registry (release unused handles)

parent fce5a39b
No related branches found
No related tags found
No related merge requests found
......@@ -68,6 +68,9 @@ public:
* method using dynamic library name to load the right module */
static Application::Pointer CreateApplicationFaster(const std::string& applicationName);
/** Clean registry by releasing unused modules */
static void CleanRegistry();
protected:
ApplicationRegistry();
virtual ~ApplicationRegistry();
......
......@@ -135,8 +135,6 @@ ApplicationRegistry::SetApplicationPath(std::string newpath)
// do NOT use putenv() directly, since the string memory must be managed carefully
itksys::SystemTools::PutEnv(putEnvPath.str().c_str());
// TODO : releaseUnusedHandle() ?
}
void
......@@ -254,8 +252,6 @@ ApplicationRegistry::CreateApplicationFaster(const std::string& name)
std::vector<std::string>
ApplicationRegistry::GetAvailableApplications(bool useFactory)
{
// TODO : releaseUnusedHandle() ?
ApplicationPointer appli;
std::set<std::string> appSet;
......@@ -343,6 +339,11 @@ ApplicationRegistry::GetAvailableApplications(bool useFactory)
return appVec;
}
void
ApplicationRegistry::CleanRegistry()
{
m_ApplicationPrivateRegistryGlobal.ReleaseUnusedHandle();
}
Application::Pointer
ApplicationRegistry::LoadApplicationFromPath(std::string path,std::string name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment