Bouke / HAP

Swift implementation of the Homekit Accessory Protocol
https://boukehaarsma.nl/HAP/
MIT License
364 stars 50 forks source link

Fix unowned self in Server.addNewConnection #69

Closed gbrooker closed 5 years ago

gbrooker commented 5 years ago

In some cases the Server instance can be deallocated when the connection closes. Changing unowned self to weak self resolves the issue.

gbrooker commented 5 years ago

The travis build check does not seem to be configured for Swift 4.2, which allows if let self = self

Bouke commented 5 years ago

Swift 4.1 is still a target as that's the latest community build available for Raspbian Stretch. Further while I'm not against this change as such, I'm working towards merging the swift-nio-http branch, which replaces Server and other connection handling logic.