From c79e71fe2cc66af384a6cb7128c8989d14c87464 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 21 Jul 2023 22:43:43 +0200 Subject: [PATCH] QHostInfo: use new QMetaCallEvent::create() overload Move the SlotObjUniquePtr directly into the QMetaCallEvent, without having to up and down the ref-count. Change-Id: I029f71c60defce71ac8778547efe999ce0cf7b4b Reviewed-by: Qt CI Bot Reviewed-by: Fabian Kosmale (cherry picked from commit 4cf51f46166b50904f0161f028a9ff1c9ba5ae3e) Reviewed-by: Qt Cherry-pick Bot --- src/network/kernel/qhostinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp index 3e1b019a93e..446f9ce4db3 100644 --- a/src/network/kernel/qhostinfo.cpp +++ b/src/network/kernel/qhostinfo.cpp @@ -110,7 +110,7 @@ void QHostInfoResult::postResultsReady(const QHostInfo &info) auto result = new QHostInfoResult(this); Q_CHECK_PTR(result); - auto metaCallEvent = QMetaCallEvent::create(slotObj.get(), nullptr, signal_index, info); + auto metaCallEvent = QMetaCallEvent::create(std::move(slotObj), nullptr, signal_index, info); Q_CHECK_PTR(metaCallEvent); qApp->postEvent(result, metaCallEvent); }