summaryrefslogtreecommitdiffstats
path: root/src/bluetooth
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth')
-rw-r--r--src/bluetooth/qbluetoothdevicediscoveryagent.cpp2
-rw-r--r--src/bluetooth/qbluetoothservicediscoveryagent.cpp3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
index 7df7bdca..eeac8f11 100644
--- a/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothdevicediscoveryagent.cpp
@@ -228,7 +228,7 @@ void QBluetoothDeviceDiscoveryAgent::start()
void QBluetoothDeviceDiscoveryAgent::stop()
{
Q_D(QBluetoothDeviceDiscoveryAgent);
- if (isActive())
+ if (isActive() && d->lastError != InvalidBluetoothAdapterError)
d->stop();
}
diff --git a/src/bluetooth/qbluetoothservicediscoveryagent.cpp b/src/bluetooth/qbluetoothservicediscoveryagent.cpp
index 23600d58..4ebe24b4 100644
--- a/src/bluetooth/qbluetoothservicediscoveryagent.cpp
+++ b/src/bluetooth/qbluetoothservicediscoveryagent.cpp
@@ -281,6 +281,9 @@ void QBluetoothServiceDiscoveryAgent::stop()
{
Q_D(QBluetoothServiceDiscoveryAgent);
+ if (d->error == InvalidBluetoothAdapterError)
+ return;
+
switch (d->discoveryState()) {
case QBluetoothServiceDiscoveryAgentPrivate::DeviceDiscovery:
d->stopDeviceDiscovery();