aboutsummaryrefslogtreecommitdiffstats
path: root/src/adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-03-02 19:12:38 -0800
committerJohan Hedberg <johan.hedberg@intel.com>2012-03-02 19:12:38 -0800
commitaf39e81ae92ed117719a77017adf2bb6b2dc5046 (patch)
tree89a15d1118b0a822564541b247bac64bf521e96c /src/adapter.c
parent226a06430538d4423f0415fde306655d5b97a4c3 (diff)
downloadbluez-af39e81ae92ed117719a77017adf2bb6b2dc5046.tar.gz
bluez-af39e81ae92ed117719a77017adf2bb6b2dc5046.tar.xz
bluez-af39e81ae92ed117719a77017adf2bb6b2dc5046.zip
core: Fix calling stop_discovery through btd_adapter_stop
Diffstat (limited to 'src/adapter.c')
-rw-r--r--src/adapter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 26952891..3c239717 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -508,7 +508,8 @@ static void stop_discovery(struct btd_adapter *adapter)
return;
}
- adapter_ops->stop_discovery(adapter->dev_id);
+ if (adapter->up)
+ adapter_ops->stop_discovery(adapter->dev_id);
}
static void session_remove(struct session_req *req)
@@ -2290,6 +2291,8 @@ int btd_adapter_stop(struct btd_adapter *adapter)
/* check pending requests */
reply_pending_requests(adapter);
+ adapter->up = FALSE;
+
stop_discovery(adapter);
if (adapter->disc_sessions) {
@@ -2320,7 +2323,6 @@ int btd_adapter_stop(struct btd_adapter *adapter)
emit_property_changed(connection, adapter->path, ADAPTER_INTERFACE,
"Powered", DBUS_TYPE_BOOLEAN, &prop_false);
- adapter->up = FALSE;
adapter->scan_mode = SCAN_DISABLED;
adapter->mode = MODE_OFF;
adapter->off_requested = FALSE;