summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2019-04-15 15:23:53 -0400
committerJoel Fischer <joeljfischer@gmail.com>2019-04-15 15:23:53 -0400
commitc4578976cdb3523af72841e110a9a42efd22950e (patch)
tree72c15706fb74ec81d8227a54ed058a57f4d80bb8
parent6ce0eae0a9a73e9cbd535c3d49c29352e6494ba1 (diff)
downloadsdl_ios-bugfix/issue_1172_state_transition.tar.gz
* Ignore connections while we are attempting to shut down and reconnect
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index 8cf5daa91..0c3b257ab 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -239,6 +239,8 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
- (void)sdl_stopManager:(BOOL)shouldRestart {
SDLLogV(@"Stopping manager, %@", (shouldRestart ? @"will restart" : @"will not restart"));
+ self.proxy = nil;
+
[self.fileManager stop];
[self.permissionManager stop];
[self.lockScreenManager stop];
@@ -259,7 +261,6 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
self.hmiLevel = nil;
self.audioStreamingState = nil;
self.systemContext = nil;
- self.proxy = nil;
// Due to a race condition internally with EAStream, we cannot immediately attempt to restart the proxy, as we will randomly crash.
// Apple Bug ID #30059457
@@ -277,6 +278,9 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
}
- (void)didEnterStateConnected {
+ // Ignore the connection while we are reconnecting. The proxy needs to be disposed and restarted in order to ensure correct state. https://github.com/smartdevicelink/sdl_ios/issues/1172
+ if ([self.lifecycleState isEqualToString:SDLLifecycleStateReconnecting]) { return; }
+
// If we have security managers, add them to the proxy
if (self.configuration.streamingMediaConfig.securityManagers != nil) {
SDLLogD(@"Adding security managers");