Skip to content

Commit

Permalink
Fix disposed socket scheduled reconnect average lab
Browse files Browse the repository at this point in the history
  • Loading branch information
veloce committed Oct 21, 2024
1 parent bf92b0a commit decd1cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/network/socket.dart
Original file line number Diff line number Diff line change
Expand Up @@ -407,9 +407,9 @@ class SocketClient {
void _scheduleReconnect(Duration delay) {
_reconnectTimer?.cancel();
_reconnectTimer = Timer(delay, () {
_averageLag.value = Duration.zero;
if (!isDisposed) {
_logger.fine('Reconnecting WebSocket.');
_averageLag.value = Duration.zero;
connect();
} else {
_logger.warning(
Expand Down

0 comments on commit decd1cd

Please sign in to comment.