summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qlowenergycontroller_winrt_new.cpp
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-10 22:42:26 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2022-11-10 22:42:26 +0200
commite957d4810b05d8453e163d7bcdcab42d3c60a7bb (patch)
tree76ed3d969c478042f8ca747bf425b0e5d2e893dc /src/bluetooth/qlowenergycontroller_winrt_new.cpp
parent47c424c7990061714bd3108e3fbaa4339ba411b9 (diff)
parenta6f5b79169991ffde38643d7b1a04d6a9de137bf (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into tqtc/lts-5.15-opensourcev5.15.8-lts-lgpl
Diffstat (limited to 'src/bluetooth/qlowenergycontroller_winrt_new.cpp')
-rw-r--r--src/bluetooth/qlowenergycontroller_winrt_new.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/bluetooth/qlowenergycontroller_winrt_new.cpp b/src/bluetooth/qlowenergycontroller_winrt_new.cpp
index a6371c0a..42f4380e 100644
--- a/src/bluetooth/qlowenergycontroller_winrt_new.cpp
+++ b/src/bluetooth/qlowenergycontroller_winrt_new.cpp
@@ -711,8 +711,8 @@ void QLowEnergyControllerPrivateWinRTNew::connectToDevice()
connect(this, &QLowEnergyControllerPrivateWinRTNew::abortConnection, worker,
&QWinRTLowEnergyConnectionHandler::handleDeviceDisconnectRequest);
connect(thread, &QThread::started, worker, &QWinRTLowEnergyConnectionHandler::connectToDevice);
- connect(thread, &QThread::finished, thread, &QObject::deleteLater);
connect(thread, &QThread::finished, worker, &QObject::deleteLater);
+ connect(worker, &QObject::destroyed, thread, &QObject::deleteLater);
connect(worker, &QWinRTLowEnergyConnectionHandler::errorOccurred, this,
[this](const QString &msg) { handleConnectionError(msg.toUtf8().constData()); });
connect(worker, &QWinRTLowEnergyConnectionHandler::deviceConnected, this,
@@ -1166,12 +1166,12 @@ void QLowEnergyControllerPrivateWinRTNew::discoverServiceDetails(const QBluetoot
QThread *thread = new QThread;
worker->moveToThread(thread);
connect(thread, &QThread::started, worker, &QWinRTLowEnergyServiceHandlerNew::obtainCharList);
- connect(thread, &QThread::finished, thread, &QObject::deleteLater);
connect(thread, &QThread::finished, worker, &QObject::deleteLater);
+ connect(worker, &QObject::destroyed, thread, &QObject::deleteLater);
connect(worker, &QWinRTLowEnergyServiceHandlerNew::errorOccured,
this, &QLowEnergyControllerPrivateWinRTNew::handleServiceHandlerError);
- connect(worker, &QWinRTLowEnergyServiceHandlerNew::charListObtained,
- [this, reactOnDiscoveryError, thread](const QBluetoothUuid &service, QHash<QLowEnergyHandle,
+ connect(worker, &QWinRTLowEnergyServiceHandlerNew::charListObtained, this,
+ [this, reactOnDiscoveryError](const QBluetoothUuid &service, QHash<QLowEnergyHandle,
QLowEnergyServicePrivate::CharData> charList, QVector<QBluetoothUuid> indicateChars,
QLowEnergyHandle startHandle, QLowEnergyHandle endHandle) {
if (!serviceList.contains(service)) {
@@ -1194,12 +1194,10 @@ void QLowEnergyControllerPrivateWinRTNew::discoverServiceDetails(const QBluetoot
if (FAILED(hr)) {
reactOnDiscoveryError(pointer,
QStringLiteral("Could not register for value changes in Xaml thread: %1").arg(hr));
- thread->exit(0);
return;
}
pointer->setState(QLowEnergyService::ServiceDiscovered);
- thread->exit(0);
});
thread->start();
}