From a32f2d34f03046adc810d710958d11890f60f6b7 Mon Sep 17 00:00:00 2001 From: Erik Date: Sat, 1 Oct 2016 10:20:13 -0400 Subject: [PATCH] Fix #521 --- Source/SocketIOClient.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/SocketIOClient.swift b/Source/SocketIOClient.swift index 062e76e..ab1c965 100644 --- a/Source/SocketIOClient.swift +++ b/Source/SocketIOClient.swift @@ -253,7 +253,9 @@ public final class SocketIOClient : NSObject, SocketEngineClient, SocketParsable } public func engineDidClose(reason: String) { - waitingPackets.removeAll() + parseQueue.sync { + self.waitingPackets.removeAll() + } if status != .disconnected { status = .notConnected