Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempted to read an unowned reference but object ... was already deallocated #189

Open
IAntolK opened this issue Jun 8, 2020 · 0 comments

Comments

@IAntolK
Copy link

IAntolK commented Jun 8, 2020

I've got a crash when was trying to write data to UDP socket:
try socket.write(from: data, to: senderAddress).
Error occurred at: Socket.swift - line 3211.
You are using unowned self which results with "Attempted to read an unowned reference but object ... was already deallocated" error if socket object is deallocated before write completes.
Possible solution would be to use [weak self].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant