summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2019-12-18 18:31:55 -0800
committerThiago Macieira <thiago.macieira@intel.com>2020-03-03 14:36:30 -0800
commitef92ac5636c2f0407fba8141c35ea61d391fd479 (patch)
treee7f1dc0a426761f09d5246d8d8ed56a4703d755c /src/corelib
parentf6c1cebe42193a62fa0b9c6a881bb1a973b1b8a9 (diff)
QLibrary: stop setting errorString after resolve()
resolve() is technically thread-safe if the library has been loadaed. We don't promise that, but it's there. More importantly, because QLibraryPrivate is shared among QPluginLoader and QLibrary that point to the same file, we can't thread-safely set the error string. [ChangeLog][Important Behavior Changes] QLibrary::resolve() will no longer set or clear the error string based on the success of finding the symbol. The error string will reflect the result of loading the library. Change-Id: I46bf1f65e8db46afbde5fffd15e1a4f4c2713c17 Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp6
-rw-r--r--src/corelib/plugin/qlibrary_win.cpp6
2 files changed, 0 insertions, 12 deletions
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 135b82cd37..23f96dbdaf 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -317,12 +317,6 @@ Q_CORE_EXPORT QFunctionPointer qt_mac_resolve_sys(void *handle, const char *symb
QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
{
QFunctionPointer address = QFunctionPointer(dlsym(pHnd, symbol));
- if (!address) {
- errorString = QLibrary::tr("Cannot resolve symbol \"%1\" in %2: %3").arg(
- QString::fromLatin1(symbol), fileName, qdlerror());
- } else {
- errorString.clear();
- }
return address;
}
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp
index 05a93d467e..c8309104aa 100644
--- a/src/corelib/plugin/qlibrary_win.cpp
+++ b/src/corelib/plugin/qlibrary_win.cpp
@@ -162,12 +162,6 @@ bool QLibraryPrivate::unload_sys()
QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
{
FARPROC address = GetProcAddress(pHnd, symbol);
- if (!address) {
- errorString = QLibrary::tr("Cannot resolve symbol \"%1\" in %2: %3").arg(
- QString::fromLatin1(symbol), QDir::toNativeSeparators(fileName), qt_error_string());
- } else {
- errorString.clear();
- }
return QFunctionPointer(address);
}
QT_END_NAMESPACE