Undefined Symbols for QT Plugins on Closing App
-
I have a application that using many plugins with a custom interface. They work great however sometime when I close the GUI using the X, I get the following error:
<executable name >symbol lookup error: <the plugin path>/libDisplayTest.so: undefined symbol: _ZN19TestPluginInterfaceD2Ev
<executeable name> exited with code 127TestPluginInterface is my plugin interface.
It seems like my plugins are not being unloaded automatically on the exit of the program?
Here is a snippit of how I load a plugin (error checking removed).
TestPluginInterface* TestManager::loadPlugin(QString pluginName) { QPluginLoader pluginLoader(pluginPath,this); pluginObject = pluginLoader.instance(); testPlugin = qobject_cast<TestPluginInterface*>(pluginObject); return(testPlugin); }Any ideas? I do not explicitly delete the plugin pointer anywhere.
-
I figure this out.
I had to change the destructor od my interface fromvirtual ~TestPluginInterface() = 0;to:
virtual ~TestPluginInterface() = default;