summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/plugin/qlibrary.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 8f1db7e4d40..4d3249d3d96 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -589,7 +589,9 @@ QtPluginInstanceFunction QLibraryPrivate::loadPlugin()
if (load()) {
auto ptr = reinterpret_cast<QtPluginInstanceFunction>(resolve("qt_plugin_instance"));
instanceFactory.storeRelease(ptr); // two threads may store the same value
- return ptr;
+ if (Q_LIKELY(ptr))
+ return ptr;
+ errorString = QLibrary::tr("Could not resolve 'qt_plugin_instance' function");
}
qCDebug(qt_lcDebugPlugins) << "QLibraryPrivate::loadPlugin failed on" << fileName << ":" << errorString;
pluginState = IsNotAPlugin;