Is there any option to find out, what causes the "unloadLibrary()" call to crash? so Far, thats what my code looks like now:
- Code: Select all
try
{
PluginLoader loader;
std::string libName("GameOfLife");
libName += Poco::SharedLibrary::suffix(); // append .dll or .so
loader.loadLibrary(libName);
{ // this is to be sure, the iterators are out of scope, when the lib gets unloaded
PluginLoader::Iterator it(loader.begin());
PluginLoader::Iterator end(loader.end());
for (; it != end; ++it)
{
PluginManifest::Iterator itMan(it->second->begin());
PluginManifest::Iterator endMan(it->second->end());
for (; itMan != endMan; ++itMan)
Log::logLine("AppManager","Found " + String(itMan->name()));;
}
}
{ // same as above...
App* pPluginA = loader.create("AppGameOfLife");
Log::logLine("AppManager","Name=" + pPluginA->getName());
loader.destroy("AppGameOfLife", pPluginA);
pPluginA = nullptr;
Log::logLine("AppManager","Deleted");
}
loader.unloadLibrary(libName);
Log::logLine("AppManager","Lib unloaded");
}
catch (exception &e)
{
Log::logLine("AppManager","Exception occured while loading plugin libraries: " + String(e.what()));
}
catch (...)
{
Log::logLine("AppManager","General Exception occured while loading plugin libraries.");
}
It loads the library and logs the name of the class found inside. It creates an object of that class and calls a function of it. It even destroys the object. Then, at the "unalodLibrary" it crashes. No exception, no error message.
What am I missing?!
Thanks in advance,
StrangeMan





