diff options
author | Muller, Alexander (A.) <amulle19@ford.com> | 2017-01-25 17:35:08 -0800 |
---|---|---|
committer | Muller, Alexander (A.) <amulle19@ford.com> | 2017-01-25 17:35:08 -0800 |
commit | 6cb518df1c62d01f16580ce00cc0bb3eedbd0193 (patch) | |
tree | c786b5abbfd2f4d9c3430821ba16de32b06d382c /SmartDeviceLink | |
parent | a8da057b1934bca241514be04c717b905bb844cc (diff) | |
download | sdl_ios-6cb518df1c62d01f16580ce00cc0bb3eedbd0193.tar.gz |
Adding a fix to restarting the proxy around an Apple Bug.
Diffstat (limited to 'SmartDeviceLink')
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index 453b3d3c4..ff17864a8 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -180,11 +180,16 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; self.hmiLevel = nil; [self sdl_disposeProxy]; // call this method instead of stopProxy to avoid double-dispatching - [self.delegate managerDidDisconnect]; - if (self.shouldRestartProxy) { - [self.lifecycleStateMachine transitionToState:SDLLifecycleStateStarted]; - } + // 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 + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.delegate managerDidDisconnect]; + + if (self.shouldRestartProxy) { + [self.lifecycleStateMachine transitionToState:SDLLifecycleStateStarted]; + } + }); } - (void)didEnterStateConnected { |