Skip to content

Commit

Permalink
fix(IoT): Fixing a race condition when invalidating/creating the reco…
Browse files Browse the repository at this point in the history
…nnect timer (#5454)
  • Loading branch information
ruisebas authored Dec 10, 2024
1 parent ce10c22 commit 582e289
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
13 changes: 10 additions & 3 deletions AWSIoT/Internal/AWSIoTMQTTClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -690,12 +690,19 @@ - (void)cleanupReconnectTimer {
waitUntilDone:NO];
return;
}

[self.reconnectTimer invalidate];
self.reconnectTimer = nil;

[self invalidateReconnectTimer];
}
}

- (void)invalidateReconnectTimer {
__weak AWSIoTMQTTClient *weakSelf = self;
dispatch_async(self.timerQueue, ^{
[weakSelf.reconnectTimer invalidate];
weakSelf.reconnectTimer = nil;
});
}

- (void)cleanUpWebsocketOutputStream {
@synchronized(self) {
if (self.websocketOutputStream) {
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

## Unreleased

-Features for next release
### Bug Fixes

- **AWSIoT**
- Fixing a race condition when invalidating/creating the reconnect timer (#5454)

## 2.38.0

Expand Down

0 comments on commit 582e289

Please sign in to comment.