Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes leak and Socket.disconnect() not calling onClose (davidstump#112)
* Fix Socket.disconnect not calling onClose Since connection.delegate is nil'd out, the Socket wasn't getting the `websocketDidDisconnect(socket:error:)` delegate message so it'd never call onClose callbacks. This also fixes an issue where the Socket would never be deinit'd because the current run loop had a strong reference to it (via the heartbeatTimer) * Stop timer & fire onClose directly instead of relying on the `onConnectionClosed()` function. `onConnectionClosed()` does some additional things that we don't want (i.e. starting the reconnect timer) to happen when a Socket is explicitly disconnected. * Add tests for disconnect() calling onClose
- Loading branch information