summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-16 01:00:07 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-09-16 01:00:07 +0200
commit1cfa636fe2c0cabbf960a02862873d4db3d3a8a8 (patch)
treec9a6d90736eb20c23706cb60ff7d4e853c2a2207 /src/corelib/kernel/qcoreapplication.cpp
parent147a8bc4c86dd7c818acd2614ee67cd7098cfa5e (diff)
parent6f8fc4217a722cf89cd3502156cc0586588fda1e (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 6647ea99f5..c537e8f51b 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -2693,7 +2693,14 @@ Q_GLOBAL_STATIC(QRecursiveMutex, libraryPathMutex)
QStringList QCoreApplication::libraryPaths()
{
QMutexLocker locker(libraryPathMutex());
+ return libraryPathsLocked();
+}
+/*!
+ \internal
+*/
+QStringList QCoreApplication::libraryPathsLocked()
+{
if (coreappdata()->manual_libpaths)
return *(coreappdata()->manual_libpaths);
@@ -2769,7 +2776,7 @@ void QCoreApplication::setLibraryPaths(const QStringList &paths)
// When the application is constructed it should still amend the paths. So we keep the originals
// around, and even create them if they don't exist, yet.
if (!coreappdata()->app_libpaths)
- libraryPaths();
+ libraryPathsLocked();
if (coreappdata()->manual_libpaths)
*(coreappdata()->manual_libpaths) = paths;
@@ -2812,7 +2819,7 @@ void QCoreApplication::addLibraryPath(const QString &path)
return;
} else {
// make sure that library paths are initialized
- libraryPaths();
+ libraryPathsLocked();
QStringList *app_libpaths = coreappdata()->app_libpaths.data();
if (app_libpaths->contains(canonicalPath))
return;
@@ -2851,7 +2858,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
return;
} else {
// make sure that library paths is initialized
- libraryPaths();
+ libraryPathsLocked();
QStringList *app_libpaths = coreappdata()->app_libpaths.data();
if (!app_libpaths->contains(canonicalPath))
return;