From 4cef3c520ff9df06650915cf89f52ccb2b10795f Mon Sep 17 00:00:00 2001 From: Rolandas Razma Date: Fri, 19 Feb 2021 10:43:23 +0000 Subject: [PATCH] don't retain WebSocketTransport during reconnect --- Sources/ApolloWebSocket/WebSocketTransport.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/ApolloWebSocket/WebSocketTransport.swift b/Sources/ApolloWebSocket/WebSocketTransport.swift index 99294bab18..4755d0b02b 100644 --- a/Sources/ApolloWebSocket/WebSocketTransport.swift +++ b/Sources/ApolloWebSocket/WebSocketTransport.swift @@ -457,8 +457,8 @@ extension WebSocketTransport: WebSocketDelegate { return } - DispatchQueue.main.asyncAfter(deadline: .now() + reconnectionInterval) { - self.websocket.connect() + DispatchQueue.main.asyncAfter(deadline: .now() + reconnectionInterval) { [weak self] in + self?.websocket.connect() } } }