Skip to content

Commit e3ecbfe

Browse files
cleanup
1 parent 03348c1 commit e3ecbfe

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/LiveViewNative/Coordinators/LiveViewCoordinator.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@ public class LiveViewCoordinator<R: RootRegistry>: ObservableObject {
345345
}
346346

347347
func join(_ liveChannel: LiveViewNativeCore.LiveChannel) {
348+
if let old = self.liveChannel {
349+
let channel = old.channel()
350+
Task { @MainActor in
351+
try await channel.shutdown()
352+
}
353+
}
354+
348355
self.liveChannel = liveChannel
349356
let channel = liveChannel.channel()
350357
self.channel = channel

0 commit comments

Comments
 (0)