diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2018-01-08 16:01:09 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-08 16:01:09 -0500 |
commit | 273698b7deb9d20719007809a29b37f787384a47 (patch) | |
tree | fac223ef3c09ef0780c29cfa2fef9c12016553a7 | |
parent | 6432ecb656cfe81974ff52eac002ac1d94f202bc (diff) | |
parent | e1755ca3e249a3ff2f787f18e9a9dedd19ffd38c (diff) | |
download | sdl_ios-273698b7deb9d20719007809a29b37f787384a47.tar.gz |
Merge pull request #834 from smartdevicelink/bugs/issue_833_app_icon_disconnect_crash
Fix crash when disconnecting while setting up app icon
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index 1643534fb..ece11b83f 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -296,8 +296,11 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; - (void)didEnterStateSettingUpAppIcon { // We only want to send the app icon when the file manager is complete, and when that's done, wait for hmi status to be ready - [self sdl_sendAppIcon:self.configuration.lifecycleConfig.appIcon withCompletion:^{ - [self.lifecycleStateMachine transitionToState:SDLLifecycleStateSettingUpHMI]; + [self sdl_sendAppIcon:self.configuration.lifecycleConfig.appIcon withCompletion:^() { + // We could have been shut down while setting up the app icon, make sure we still want to continue or we could crash + if (self.lifecycleState == SDLLifecycleStateSettingUpAppIcon) { + [self.lifecycleStateMachine transitionToState:SDLLifecycleStateSettingUpHMI]; + } }]; } @@ -361,6 +364,7 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; SDLLogW(@"Failed to upload app icon: A file with this name already exists on the system"); } else { SDLLogW(@"Unexpected error uploading app icon: %@", error); + completion(); return; } } |