diff --git a/cmake/QtProcessConfigureArgs.cmake b/cmake/QtProcessConfigureArgs.cmake index 330de3e6b33..8d4cef232bf 100644 --- a/cmake/QtProcessConfigureArgs.cmake +++ b/cmake/QtProcessConfigureArgs.cmake @@ -596,7 +596,7 @@ endmacro() macro(translate_list_input name cmake_var) if(DEFINED INPUT_${name}) - list(JOIN INPUT_${name} "\\;" value) + list(JOIN INPUT_${name} "[[;]]" value) list(APPEND cmake_args "-D${cmake_var}=${value}") drop_input(${name}) endif() @@ -763,7 +763,7 @@ if(nr_of_build_configs EQUAL 1) push("-DCMAKE_BUILD_TYPE=${build_configs}") elseif(nr_of_build_configs GREATER 1) set(multi_config ON) - string(REPLACE ";" "\\;" escaped_build_configs "${build_configs}") + string(REPLACE ";" "[[;]]" escaped_build_configs "${build_configs}") # We must not use the push macro here to avoid variable expansion. # That would destroy our escaping. list(APPEND cmake_args "-DCMAKE_CONFIGURATION_TYPES=${escaped_build_configs}") diff --git a/src/concurrent/qtconcurrentiteratekernel.cpp b/src/concurrent/qtconcurrentiteratekernel.cpp index 430ae89c856..268db562465 100644 --- a/src/concurrent/qtconcurrentiteratekernel.cpp +++ b/src/concurrent/qtconcurrentiteratekernel.cpp @@ -131,7 +131,7 @@ void BlockSizeManager::timeAfterUser() if (controlPartElapsed.isMedianValid() == false) return; - if (controlPartElapsed.median() * TargetRatio < userPartElapsed.median()) + if (controlPartElapsed.median() * int(TargetRatio) < userPartElapsed.median()) return; m_blockSize = qMin(m_blockSize * 2, maxBlockSize); diff --git a/src/corelib/thread/qfuture_impl.h b/src/corelib/thread/qfuture_impl.h index 8e7ba0c4b59..e455a74793d 100644 --- a/src/corelib/thread/qfuture_impl.h +++ b/src/corelib/thread/qfuture_impl.h @@ -807,34 +807,34 @@ static QFuture> connect(Sender *sender, Signal signal) if constexpr (std::is_void_v) { connections->first = QObject::connect(sender, signal, sender, [promise, connections]() mutable { - promise.reportFinished(); QObject::disconnect(connections->first); QObject::disconnect(connections->second); + promise.reportFinished(); }); } else if constexpr (QtPrivate::isTupleV) { connections->first = QObject::connect(sender, signal, sender, [promise, connections](auto... values) mutable { - promise.reportResult(std::make_tuple(values...)); - promise.reportFinished(); QObject::disconnect(connections->first); QObject::disconnect(connections->second); + promise.reportResult(std::make_tuple(values...)); + promise.reportFinished(); }); } else { connections->first = QObject::connect(sender, signal, sender, [promise, connections](ArgsType value) mutable { - promise.reportResult(value); - promise.reportFinished(); QObject::disconnect(connections->first); QObject::disconnect(connections->second); + promise.reportResult(value); + promise.reportFinished(); }); } connections->second = QObject::connect(sender, &QObject::destroyed, sender, [promise, connections]() mutable { - promise.reportCanceled(); - promise.reportFinished(); QObject::disconnect(connections->first); QObject::disconnect(connections->second); + promise.reportCanceled(); + promise.reportFinished(); }); return promise.future(); diff --git a/src/network/kernel/qnetworkinformation.cpp b/src/network/kernel/qnetworkinformation.cpp index d10024bf05e..0c41a3a42ef 100644 --- a/src/network/kernel/qnetworkinformation.cpp +++ b/src/network/kernel/qnetworkinformation.cpp @@ -432,7 +432,7 @@ QNetworkInformationBackendFactory::~QNetworkInformationBackendFactory() \value Unknown If this value is returned then we may be connected but the OS - has still not confirmed full connectivity, or this features + has still not confirmed full connectivity, or this feature is not supported. \value Disconnected Indicates that the system may have no connectivity at all. diff --git a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp index 71cfbd054b7..5f6267ec7d6 100644 --- a/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp +++ b/tests/auto/corelib/thread/qfuture/tst_qfuture.cpp @@ -3228,6 +3228,25 @@ void tst_QFuture::signalConnect() QVERIFY(future.isCanceled()); QVERIFY(!future.isValid()); } + + // Signal emitted, causing Sender to be destroyed + { + SenderObject *sender = new SenderObject(); + + auto future = QtFuture::connect(sender, &SenderObject::intArgSignal); + future.then([sender](int) { + // Scenario: Sender no longer needed, so it's deleted + delete sender; + }); + + QSignalSpy spy(sender, &SenderObject::destroyed); + emit sender->intArgSignal(5); + spy.wait(); + + QVERIFY(future.isFinished()); + QVERIFY(!future.isCanceled()); + QVERIFY(future.isValid()); + } } void tst_QFuture::waitForFinished()