summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@digia.com>2014-05-12 13:16:09 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-23 08:46:27 +0200
commiteaf88aa2c5b7e28a28d8f863a0bac408260d1191 (patch)
treef5977f943cd23c717f2cb85cc6b5460826f73b99 /src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
parent66cc81ed8df87103409140547b4e017647e80d61 (diff)
Fix crash during call to QBluetoothServiceDiscoveryAgent::stop()
This was triggered when the stop() call was made while the SDP thread was talking to the SDP server. Change-Id: If6624dce21ca4a099d5beae064685b6b3a907989 Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp')
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
index 2f7dc726..6d3e4c96 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent_bluez.cpp
@@ -333,7 +333,7 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_finishSdpScan(QBluetoothServiceD
error = errorCode;
errorString = errorDescription;
emit q->error(error);
- } else if (!xmlRecords.isEmpty()) {
+ } else if (!xmlRecords.isEmpty() && discoveryState() != Inactive) {
foreach (const QString &record, xmlRecords) {
const QBluetoothServiceInfo serviceInfo = parseServiceXml(record);
@@ -363,10 +363,6 @@ void QBluetoothServiceDiscoveryAgentPrivate::_q_finishSdpScan(QBluetoothServiceD
emit q->serviceDiscovered(serviceInfo);
}
-
- // could stop discovery, check for state
- if (discoveryState() == Inactive)
- qCDebug(QT_BT_BLUEZ) << "Exit discovery after stop";
}
}