File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ class MultiLibraryClassLoader
7373 for (unsigned int c = 0 ; c < active_loaders.size (); c++)
7474 {
7575 ClassLoader* current = active_loaders.at (c);
76+ if (!current->isLibraryLoaded ())
77+ current->loadLibrary ();
7678 if (current->isClassAvailable <Base>(class_name))
7779 return (current->createInstance <Base>(class_name));
7880 }
@@ -113,6 +115,8 @@ class MultiLibraryClassLoader
113115 for (unsigned int c = 0 ; c < active_loaders.size (); c++)
114116 {
115117 ClassLoader* current = active_loaders.at (c);
118+ if (!current->isLibraryLoaded ())
119+ current->loadLibrary ();
116120 if (current->isClassAvailable <Base>(class_name))
117121 return (current->createUnmanagedInstance <Base>(class_name));
118122 }
Original file line number Diff line number Diff line change @@ -39,7 +39,10 @@ enable_ondemand_loadunload_(enable_ondemand_loadunload)
3939
4040MultiLibraryClassLoader::~MultiLibraryClassLoader ()
4141{
42- shutdownAllClassLoaders ();
42+ if (!isOnDemandLoadUnloadEnabled ())
43+ shutdownAllClassLoaders (); // don't unload libs to avoid SEVERE WARNING
44+ // TODO: free ClassLoaders in active_class_loaders_
45+ // However, we still need them in on-demand-load-unload mode. Otherwise we risk seg-faults.
4346}
4447
4548std::vector<std::string> MultiLibraryClassLoader::getRegisteredLibraries ()
You can’t perform that action at this time.
0 commit comments