From 49c5724cb8eeebf8176b2122401716f8d11bcc11 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 19 May 2021 12:05:23 +0200 Subject: QPromise/QFutureInterface: in Qt 7 take std::exception_ptr by const-ref std::exception_ptr is a reference-counted "smart pointer", so we shouldn't copy it around freely. Unfortunately QFutureInterface has exported functions taking it by value, so we can't just change the signatures and keep BC. Simply prepare the code for Qt 7. Change-Id: Ic5aae6a095c8c842872a40db440c99d2dfe371f1 Reviewed-by: Sona Kurazyan Reviewed-by: Andrei Golubev --- src/corelib/thread/qfutureinterface.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/corelib/thread/qfutureinterface.cpp') diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp index 22c8a48411..8906245191 100644 --- a/src/corelib/thread/qfutureinterface.cpp +++ b/src/corelib/thread/qfutureinterface.cpp @@ -351,7 +351,11 @@ void QFutureInterfaceBase::reportException(const QException &exception) } } +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) void QFutureInterfaceBase::reportException(std::exception_ptr exception) +#else +void QFutureInterfaceBase::reportException(const std::exception_ptr &exception) +#endif { QMutexLocker locker(&d->m_mutex); if (d->state.loadRelaxed() & (Canceled|Finished)) -- cgit v1.2.3