mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
Fix when QQmlComponent throws error while init plugin
This commit is contained in:
parent
316bc85eb6
commit
6cb052e79b
|
@ -474,7 +474,7 @@ void Plugins::initQmlPlugin(Plugin *plugin)
|
|||
|
||||
plugin->qmlPluginLoader->createComponent();
|
||||
if (!plugin->qmlPluginLoader->instance()) {
|
||||
qWarning() << "Initializing" << name << "failed:" << plugin->qmlPluginLoader->component()->errorString();
|
||||
qWarning().noquote() << "Falied to create component for" << name << "plugin:" << plugin->qmlPluginLoader->component()->errorString();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,11 @@ QmlPluginLoader::QmlPluginLoader(const QString &path)
|
|||
void QmlPluginLoader::createComponent()
|
||||
{
|
||||
m_interface = qobject_cast<QmlPluginInterface*>(m_component->create());
|
||||
|
||||
if (!m_interface) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_interface->setEngine(m_engine);
|
||||
connect(m_interface, &QmlPluginInterface::qmlPluginUnloaded, this, [this]{
|
||||
delete m_component;
|
||||
|
|
Loading…
Reference in New Issue
Block a user