Closed slice closed 2 years ago
Hi, I couldn't spot a retain cycle in my app after calling disconnect:
I don't see a the purple exclamation on my NWWebSocket, although please correct me if I'm missing something.
If I'm not, I'd like to see more of your code if possible.
Sure thing. I was using NWWebSocket in my code here.
Since you can't seem to reproduce the retain cycle, I'm going to assume that I was doing something incorrectly, and Xcode was unable to display the root problem in my code via the memory graph. Feel free to close this issue in that case.
[A bit later...]
https://developer.apple.com/documentation/macos-release-notes/macos-13-release-notes
Looks like this could be relevant. Not sure if the issue is resolved in the betas; I don't install them on my Macs and I'm no longer using NWWebSocket. But I just thought I'd bring this up.
Thanks for that.
I will close this, since this can't be reproduced.
I'm trying to call
NWWebSocket.disconnect()
in my app, but the WebSocket never appears to actually get closed.If I pull up a memory graph, there's a retain cycle:
Xcode says that a strong capture in the closure in
NWWebSocket.scheduleDisconnectionReporting
is retaining the object:The
webSocketDidDisconnect
delegate method does get called (with a close code of1001
), but the WebSocket stays connected.