AutosoftDMS / SignalR-Swift

SignalR client library written in pure Swift
MIT License
60 stars 55 forks source link

Heartbeat monitor & crash & refactoring #31

Closed vldalx closed 6 years ago

vldalx commented 6 years ago

A wrong logic in HeartbeatMonitor.

Compare the next 2 snippets: https://github.com/AutosoftDMS/SignalR-Swift/blob/a8ded012ff2991004375e14c2de054999a1c8e51/SignalR-Swift/Client/HeartbeatMonitor.swift#L49-L50 and https://github.com/DyKnow/SignalR-ObjC/blob/c412cc38618b27c83fe170eaa9da95aa0c7eb42a/SignalR.Client/SRHeartbeatMonitor.m#L65-L68 This is the only place that the field is set to true. The same error is here https://github.com/AutosoftDMS/SignalR-Swift/blob/a8ded012ff2991004375e14c2de054999a1c8e51/SignalR-Swift/Client/HeartbeatMonitor.swift#L54-L55

A crash.

https://github.com/AutosoftDMS/SignalR-Swift/blob/a8ded012ff2991004375e14c2de054999a1c8e51/SignalR-Swift/Client/Connection.swift#L260-L262 The problem is the unowned reference