Kitura / Kitura/BlueSocket

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

Open
#189 0 comments 0 reactions 1 assignee Claimed by @adam-rocska View on GitHub
Dominant language
Swift
Stars
1.4k
Forks
193
PR merge metrics
No merged PRs in 30d

Description

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].`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.