Skip to content

Commit 9d53f4d

Browse files
committed
ensure controller monitor task cancelled before replacing
1 parent 613c339 commit 9d53f4d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Sources/SwiftOCA/OCP.1/Ocp1Connection+Connect.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ extension Ocp1Connection {
114114
private func _startMonitor() {
115115
connectionID &+= 1
116116
let monitor = Monitor(self, id: connectionID)
117+
monitorTask?.cancel()
117118
monitorTask = Task {
118119
try await monitor.run()
119120
}

0 commit comments

Comments
 (0)