diff options
author | Ivan Solovev <ivan.solovev@qt.io> | 2022-08-11 12:04:35 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-15 09:18:45 +0000 |
commit | b7a7e31f95c09c3ac11260c18964665aae183c6b (patch) | |
tree | 91b5ab4d998fbbf250e09f6cee0e098cbd32bd49 | |
parent | 2e4fd55a55f8a247c49616cb8232a88b18b59ae6 (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.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index c02eb5f3..637a9fa3 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -387,6 +387,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(); |