Commit 1e92b846 authored by Eike Ziller's avatar Eike Ziller

PluginManager: Destruct plugins that fail to initialize

Directly destruct the plugin after failed initialization, instead of
letting the plugin loader clean up automatically just before application
destruction (which would be after all other plugins are already
destructed).

Change-Id: Ic459a652fdb99c3e3ee1a7561334ba7075c9c666
Reviewed-by: default avatarDaniel Teske <daniel.teske@theqtcompany.com>
parent 53a941de
......@@ -983,6 +983,9 @@ bool PluginSpecPrivate::initializePlugin()
if (!plugin->initialize(arguments, &err)) {
errorString = QCoreApplication::translate("PluginSpec", "Plugin initialization failed: %1").arg(err);
hasError = true;
// clean up
loader.unload();
plugin = 0;
return false;
}
state = PluginSpec::Initialized;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment