File tree 2 files changed +8
-1
lines changed
2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,8 @@ class MultiLibraryClassLoader
73
73
for (unsigned int c = 0 ; c < active_loaders.size (); c++)
74
74
{
75
75
ClassLoader* current = active_loaders.at (c);
76
+ if (!current->isLibraryLoaded ())
77
+ current->loadLibrary ();
76
78
if (current->isClassAvailable <Base>(class_name))
77
79
return (current->createInstance <Base>(class_name));
78
80
}
@@ -113,6 +115,8 @@ class MultiLibraryClassLoader
113
115
for (unsigned int c = 0 ; c < active_loaders.size (); c++)
114
116
{
115
117
ClassLoader* current = active_loaders.at (c);
118
+ if (!current->isLibraryLoaded ())
119
+ current->loadLibrary ();
116
120
if (current->isClassAvailable <Base>(class_name))
117
121
return (current->createUnmanagedInstance <Base>(class_name));
118
122
}
Original file line number Diff line number Diff line change @@ -39,7 +39,10 @@ enable_ondemand_loadunload_(enable_ondemand_loadunload)
39
39
40
40
MultiLibraryClassLoader::~MultiLibraryClassLoader ()
41
41
{
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.
43
46
}
44
47
45
48
std::vector<std::string> MultiLibraryClassLoader::getRegisteredLibraries ()
You can’t perform that action at this time.
0 commit comments