summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
index 5376ad2f..2562395a 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp
@@ -441,8 +441,11 @@ void QWinRTBluetoothDeviceDiscoveryWorker::classicBluetoothInfoFromDeviceIdAsync
hr = deviceFromIdOperation->put_Completed(Callback<IAsyncOperationCompletedHandler<BluetoothDevice *>>
([thisPointer](IAsyncOperation<BluetoothDevice *> *op, AsyncStatus status)
{
- if (status == Completed && thisPointer)
- thisPointer->onPairedClassicBluetoothDeviceFoundAsync(op, status);
+ if (thisPointer) {
+ if (status == Completed)
+ thisPointer->onPairedClassicBluetoothDeviceFoundAsync(op, status);
+ --thisPointer->m_pendingPairedDevices;
+ }
return S_OK;
}).Get());
if (FAILED(hr)) {
@@ -475,8 +478,11 @@ void QWinRTBluetoothDeviceDiscoveryWorker::leBluetoothInfoFromDeviceIdAsync(HSTR
hr = deviceFromIdOperation->put_Completed(Callback<IAsyncOperationCompletedHandler<BluetoothLEDevice *>>
([thisPointer] (IAsyncOperation<BluetoothLEDevice *> *op, AsyncStatus status)
{
- if (status == Completed && thisPointer)
- thisPointer->onPairedBluetoothLEDeviceFoundAsync(op, status);
+ if (thisPointer) {
+ if (status == Completed)
+ thisPointer->onPairedBluetoothLEDeviceFoundAsync(op, status);
+ --thisPointer->m_pendingPairedDevices;
+ }
return S_OK;
}).Get());
if (FAILED(hr)) {