diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2016-08-08 09:28:52 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2016-08-09 06:57:40 +0000 |
commit | 70bb2f8d1fc45738859e1b4b1127db5c0de6cec9 (patch) | |
tree | 849dc69fbd232c9619f02e631350cbd5304701de /src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | |
parent | 1e31c7028208bd267dfd513b036b6a7a78118226 (diff) |
winrt: Add missing error handling for device discovery
Change-Id: Idbda4faf542baf2fa7ad652cfa90701fb0f9020c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index db1592b1..5f24f150 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -178,8 +178,11 @@ public: ~QWinRTBluetoothDeviceDiscoveryWorker() { - if (leDeviceWatcher && leDeviceAddedToken.value) - leDeviceWatcher->remove_Added(leDeviceAddedToken); + if (leDeviceWatcher && leDeviceAddedToken.value) { + HRESULT hr; + hr = leDeviceWatcher->remove_Added(leDeviceAddedToken); + Q_ASSERT_SUCCEEDED(hr); + } } private: @@ -221,7 +224,9 @@ private: { qCDebug(QT_BT_WINRT) << (mode == BT ? "BT" : "BTLE") << "scan completed"; ComPtr<IVectorView<DeviceInformation *>> devices; - op->GetResults(&devices); + HRESULT hr; + hr = op->GetResults(&devices); + Q_ASSERT_SUCCEEDED(hr); onDevicesFound(devices.Get(), mode); initializedModes |= mode; if (initializedModes == BTAll) { |