Skip to content

Commit c049b52

Browse files
committed
don't capture self in message handler task
1 parent b27e922 commit c049b52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SwiftOCADevice/OCP.1/Ocp1ControllerInternal.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ extension Ocp1ControllerInternal {
180180
await withTaskGroup(of: Void.self) { group in
181181
do {
182182
for try await messageList in messages {
183-
group.addTask {
184-
try? await self.handle(for: endpoint, messageList: messageList)
183+
group.addTask { [weak self] in
184+
try? await self?.handle(for: endpoint, messageList: messageList)
185185
}
186186
}
187187
} catch Ocp1Error.notConnected {

0 commit comments

Comments
 (0)