diff --git a/src/device.c b/src/device.c
index 18d0d46..bd513ec 100644
--- a/src/device.c
+++ b/src/device.c
DBusMessage *reply;
struct browse_req *req = dev->browse;
+ DBG("%s err %d", dev->path, err);
+
dev->svc_resolved = true;
- dev->svc_refreshed = true;
dev->browse = NULL;
+ /* Disconnection notification can happen before this function
+ * gets called, so don't set svc_refreshed for a disconnected
+ * device.
+ */
+ if (dev->connected)
+ dev->svc_refreshed = true;
+
g_slist_free_full(dev->eir_uuids, g_free);
dev->eir_uuids = NULL;