Merge pull request #651 from musicabbage/development
remove engine’s listener before assign new instance
This commit is contained in:
commit
1669f2c28f
@ -243,6 +243,8 @@ public final class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePoll
|
||||
}
|
||||
|
||||
private func createWebsocketAndConnect() {
|
||||
|
||||
ws?.delegate = nil
|
||||
ws = WebSocket(url: urlWebSocketWithSid as URL)
|
||||
|
||||
if cookies != nil {
|
||||
|
||||
@ -120,6 +120,7 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable
|
||||
private func addEngine() -> SocketEngineSpec {
|
||||
DefaultSocketLogger.Logger.log("Adding engine", type: logType, args: "")
|
||||
|
||||
engine?.client = nil
|
||||
engine = SocketEngine(client: self, url: socketURL, config: config)
|
||||
|
||||
return engine!
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user