summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qexception.cpp4
-rw-r--r--src/corelib/thread/qexception.h2
-rw-r--r--src/corelib/thread/qorderedmutexlocker_p.h6
3 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp
index e45e6f4895..62c2b608d8 100644
--- a/src/corelib/thread/qexception.cpp
+++ b/src/corelib/thread/qexception.cpp
@@ -171,7 +171,7 @@ public:
};
ExceptionHolder::ExceptionHolder(QException *exception)
-: base(new Base(exception)) {}
+: base(exception ? new Base(exception) : Q_NULLPTR) {}
ExceptionHolder::ExceptionHolder(const ExceptionHolder &other)
: base(other.base)
@@ -187,6 +187,8 @@ ExceptionHolder::~ExceptionHolder()
QException *ExceptionHolder::exception() const
{
+ if (!base)
+ return Q_NULLPTR;
return base->exception;
}
diff --git a/src/corelib/thread/qexception.h b/src/corelib/thread/qexception.h
index 329b5610de..b14d386c69 100644
--- a/src/corelib/thread/qexception.h
+++ b/src/corelib/thread/qexception.h
@@ -92,7 +92,7 @@ class Q_CORE_EXPORT ExceptionHolder
public:
ExceptionHolder(QException *exception = Q_NULLPTR);
ExceptionHolder(const ExceptionHolder &other);
- void operator=(const ExceptionHolder &other);
+ void operator=(const ExceptionHolder &other); // ### Qt6: copy-assign operator shouldn't return void. Remove this method and the copy-ctor, they are unneeded.
~ExceptionHolder();
QException *exception() const;
QExplicitlySharedDataPointer<Base> base;
diff --git a/src/corelib/thread/qorderedmutexlocker_p.h b/src/corelib/thread/qorderedmutexlocker_p.h
index fbe9a15d98..f54f7c705d 100644
--- a/src/corelib/thread/qorderedmutexlocker_p.h
+++ b/src/corelib/thread/qorderedmutexlocker_p.h
@@ -53,6 +53,8 @@
#include <QtCore/qmutex.h>
+#include <functional>
+
QT_BEGIN_NAMESPACE
/*
@@ -63,8 +65,8 @@ class QOrderedMutexLocker
{
public:
QOrderedMutexLocker(QMutex *m1, QMutex *m2)
- : mtx1((m1 == m2) ? m1 : (m1 < m2 ? m1 : m2)),
- mtx2((m1 == m2) ? 0 : (m1 < m2 ? m2 : m1)),
+ : mtx1((m1 == m2) ? m1 : (std::less<QMutex *>()(m1, m2) ? m1 : m2)),
+ mtx2((m1 == m2) ? 0 : (std::less<QMutex *>()(m1, m2) ? m2 : m1)),
locked(false)
{
relock();