Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
fix: Memory leak when using reactive subscriptions with KeepAlive
Browse files Browse the repository at this point in the history
  • Loading branch information
KriKroff committed May 26, 2021
1 parent 897c477 commit 088b32c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
public class ReactiveWebSocketSubscriptionSession extends DefaultSubscriptionSession {

private final WebSocketSession webSocketSession;
private boolean opened = true;

public ReactiveWebSocketSubscriptionSession(
GraphQLSubscriptionMapper mapper, WebSocketSession webSocketSession) {
Expand All @@ -17,7 +18,7 @@ public ReactiveWebSocketSubscriptionSession(

@Override
public boolean isOpen() {
return true;
return opened;
}

@Override
Expand All @@ -34,4 +35,10 @@ public String getId() {
public WebSocketSession unwrap() {
return webSocketSession;
}

@Override
public void close(final String reason) {
super.close(reason);
this.opened = false;
}
}

0 comments on commit 088b32c

Please sign in to comment.