From 5f40e1d759d510199f7a01535527cd77eaf116ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leon=20B=C3=B6ttger?= Date: Sun, 27 Jul 2025 20:54:28 +0200 Subject: [PATCH] Fix could not restart device discovery after stopping --- NearbyShare/Connection/NearbyConnectionManager.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NearbyShare/Connection/NearbyConnectionManager.swift b/NearbyShare/Connection/NearbyConnectionManager.swift index 1b44b59..c1f29ee 100644 --- a/NearbyShare/Connection/NearbyConnectionManager.swift +++ b/NearbyShare/Connection/NearbyConnectionManager.swift @@ -163,11 +163,15 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb public func stopDeviceDiscovery() { if startedDeviceDiscovery { + + log("Stopping device discovery") + for browser in browsers { browser.cancel() } browsers.removeAll() + startedDeviceDiscovery = false } }