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