diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-29 03:01:25 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-09-29 03:01:25 +0200 |
commit | 09fce1ba38f6ceee9207785ff60ce59e3737110d (patch) | |
tree | 616fadf122893b80c70c3a19d18a0306a4850047 /src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | |
parent | 145035cc9eb81fb4ff5258b90eca796e581aef9c (diff) | |
parent | 54f9fe2c230963797dd4f0f9efed7132b0dc429e (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I0a4a8e2c1ace22466ade52ae27a3112ddc67cb28
Diffstat (limited to 'src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp index 309804a8..ef2a69b1 100644 --- a/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp +++ b/src/bluetooth/qbluetoothdevicediscoveryagent_winrt.cpp @@ -476,10 +476,14 @@ HRESULT QWinRTBluetoothDeviceDiscoveryWorker::onBluetoothLEDeviceFound(ComPtr<IB // We need a paired device in order to be able to obtain its information if (!isPaired) { ComPtr<IAsyncOperation<DevicePairingResult *>> pairingOp; + QPointer<QWinRTBluetoothDeviceDiscoveryWorker> tPointer(this); hr = pairing.Get()->PairAsync(&pairingOp); Q_ASSERT_SUCCEEDED(hr); pairingOp.Get()->put_Completed( - Callback<IAsyncOperationCompletedHandler<DevicePairingResult *>>([device, this](IAsyncOperation<DevicePairingResult *> *op, AsyncStatus status) { + Callback<IAsyncOperationCompletedHandler<DevicePairingResult *>>([device, tPointer](IAsyncOperation<DevicePairingResult *> *op, AsyncStatus status) { + if (!tPointer) + return S_OK; + if (status != AsyncStatus::Completed) { qCDebug(QT_BT_WINRT) << "Could not pair device"; return S_OK; @@ -496,7 +500,7 @@ HRESULT QWinRTBluetoothDeviceDiscoveryWorker::onBluetoothLEDeviceFound(ComPtr<IB return S_OK; } - onBluetoothLEDeviceFound(device, OmitPairingCheck); + tPointer->onBluetoothLEDeviceFound(device, OmitPairingCheck); return S_OK; }).Get()); return S_OK; |