Skip to content

Commit 196f448

Browse files
authored
Fix memory leak in HubConnection (#20099)
1 parent 543e73b commit 196f448

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/SignalR/clients/java/signalr/src/main/java/com/microsoft/signalr/HubConnection.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,11 @@ private void stopConnection(String errorMessage) {
518518
connectionState = null;
519519
}
520520

521+
if (pingTimer != null) {
522+
pingTimer.cancel();
523+
pingTimer = null;
524+
}
525+
521526
logger.info("HubConnection stopped.");
522527
hubConnectionState = HubConnectionState.DISCONNECTED;
523528
handshakeResponseSubject.onComplete();

0 commit comments

Comments
 (0)