summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-08-11 12:04:35 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-15 09:18:45 +0000
commit5a9a1808710adaf3a781449caad11ebd006b4577 (patch)
tree5946d05d3ce9fb83f01b4b599ad642ef341a0847
parenta97fea825f857e9225e5ff02328ff9451cb2a117 (diff)
QWinRTBluetoothDeviceDiscoveryWorker: properly stop LE scan timer
The LE scan timer was never stopped if the device discovery was finished earlier than the timer expires. That could lead to an application crash. This patch fixes it by making sure that the timer is stopped when QWinRTBluetoothDeviceDiscoveryWorker::stop() is called. This commit amends 9ab5122091a65936458c726270e693eca7a99277 Task-number: QTBUG-103263 Task-number: QTBUG-97797 Change-Id: If10d9c1ef9f822b991225736ae36aceabe7e60a7 Reviewed-by: Juha Vuolle <juha.vuolle@insta.fi> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 0beadce4cf588633843f41fad51556559f9a6af7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
index 13e43df9..44932e1d 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
@@ -354,6 +354,8 @@ void QWinRTBluetoothDeviceDiscoveryWorker::start()
void QWinRTBluetoothDeviceDiscoveryWorker::stop()
{
+ if (m_leScanTimer && m_leScanTimer->isActive())
+ m_leScanTimer->stop();
m_classicWatcher->stop();
m_lowEnergyWatcher->stop();
m_advertisementWatcher->stop();