Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Sources/Socket/SocketManager/AsyncSocketManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,12 @@ private extension AsyncSocketManager {
else { return }
log("Will start monitoring")
state.isMonitoring = true

// Create top level task to monitor
Task.detached(priority: state.configuration.monitorPriority) { [unowned self] in
await self.run()
// MEMO: Using [weak self] instead of [unowned self] to work around a compiler bug.
// This issue only occurs in CI environments, where using [unowned self] causes a compiler crash under certain conditions.
Task.detached(priority: state.configuration.monitorPriority) { [weak self] in
await self?.run()
}
}

Expand Down