Skip to content

Commit 2cbfe28

Browse files
anthonyguellaAnthony Guella
andauthored
fix: memory leak in AppSyncWebSocketClient (#41)
Description of changes: WebSocketTransport holds a strong reference to AppSyncWebSocketClient, and vice versa. This causes a retain cycle that can be solved by making AppSyncWebSocketClient's reference weak. Testing: Verified solution via memory graph debugger. Co-authored-by: Anthony Guella <anthkgue@audible.com>
1 parent fae511f commit 2cbfe28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/AWSAppSyncApolloExtensions/Websocket/AppSyncWebSocketClient.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class AppSyncWebSocketClient: NSObject, ApolloWebSocket.WebSocketClient,
1717

1818
// MARK: - ApolloWebSocket.WebSocketClient
1919

20-
public var delegate: ApolloWebSocket.WebSocketClientDelegate?
20+
public weak var delegate: ApolloWebSocket.WebSocketClientDelegate?
2121
public var callbackQueue: DispatchQueue
2222

2323
private let requestLock = NSLock()

0 commit comments

Comments
 (0)