summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-09-19 11:47:10 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2021-09-19 13:56:20 +0200
commit7eeda336b4ab45e6869f848d6378043337cd37a1 (patch)
treef084b5de2033e25a80ecf2b74d3e5b155bbec3da
parentefb90f6e7ed3e8d4f7b6c0fb96012cb3a9a9d037 (diff)
Switch a comma operator to a IILE
A comma operator results in a discarded-value expression, meaning the compiler is going to complain the moment we mark QMutexLocker as nodiscard. Turn the comma into a functionally equivalent IILE. Change-Id: I33826902c8471016490aac25160b70c609dafd90 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index c6af4f9636..b67c3b6439 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -548,7 +548,7 @@ void QLibraryPrivate::setLoadHints(QLibrary::LoadHints lh)
QObject *QLibraryPrivate::pluginInstance()
{
// first, check if the instance is cached and hasn't been deleted
- QObject *obj = (QMutexLocker(&mutex), inst.data());
+ QObject *obj = [&](){ QMutexLocker locker(&mutex); return inst.data(); }();
if (obj)
return obj;