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 10:18:45 +0000
commitcbb4c3de1716a91b65db05522ca8b0e1c3dac651 (patch)
treed9640d82400b93551b6671b272c855f02cbe6480
parent9e9ddda115aa1b14aec1a5bf7de73d7158cfdab8 (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 1da21009..f8b22467 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
@@ -352,6 +352,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();