diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-06-07 20:15:39 +0200 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2021-06-12 03:08:59 +0200 |
commit | 6460c3c33d8f880c50e2b529827437e442d05bd3 (patch) | |
tree | 329c03c69e345296c26bb0b589eab685f2246a62 /src/corelib/thread/qexception.cpp | |
parent | e0ae1af278f3cc6df6c3f66e4118585cc8384b15 (diff) |
QFuture: put the result store and the exception store in a union
QFuture doesn't need both at the same time, calling QFuture::result(s)
either returns a result or throws an exception. Store result and
exception stores in a union, to reduce the memory.
Also added a note for making the ResultStoreBase destructor non-virtual
in Qt 7.
Task-number: QTBUG-92045
Change-Id: I7f0ac03804d19cc67c1a1466c7a1365219768a14
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/corelib/thread/qexception.cpp')
-rw-r--r-- | src/corelib/thread/qexception.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp index c9b7fb6cf6..8967e9db1c 100644 --- a/src/corelib/thread/qexception.cpp +++ b/src/corelib/thread/qexception.cpp @@ -252,6 +252,12 @@ void ExceptionStore::throwPossibleException() std::rethrow_exception(exceptionHolder); } +void ExceptionStore::rethrowException() const +{ + Q_ASSERT(hasException()); + std::rethrow_exception(exceptionHolder); +} + } // namespace QtPrivate #endif //Q_CLANG_QDOC |