로딩
요청 처리 중입니다...

Swift Concurrency 와 retain cycle(memory leak)

 Swift Concurrency 와 retain cycle(memory leak)

스위프트 Concurrency의 메모리 추적 시스템인 조금 독특하다 그 예시를 위해서 먼저 세팅을 해주자 import Foundation import Combine class Concurrency { let publisher = PassthroughSubject() let (stream, continuation) = AsyncStream.makeStream() init() { listen() } func sendEvent() { Task { [weak self] in self?.publisher.send() self?.

continuation.yield() try! await Task.sleep(nanoseconds: 1_000_000_000) self?.

publisher.send() self?.continuation.yield() try!

await Task.sleep(nanoseconds: 1_000_000_000) self?.publisher.s...

# concurrency # iOS # swift # Xcode