summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Fischer <joeljfischer@gmail.com>2017-03-01 15:51:56 -0500
committerGitHub <noreply@github.com>2017-03-01 15:51:56 -0500
commit16104d97b753bce1795798b3a2852a91b62cde4a (patch)
tree9ff8add0a7ef48ff95048d2264803ccfce3a34fc
parent1109f73e492a593c1d1c53ed6d19999c5e5f16f3 (diff)
parentbf23cb383e886300008777baa3a2756ce271506d (diff)
downloadsdl_ios-16104d97b753bce1795798b3a2852a91b62cde4a.tar.gz
Merge pull request #551 from smartdevicelink/hotfix/issue_549
Fix crash when trying to start and already started SDLManager
-rw-r--r--SmartDeviceLink/SDLLifecycleManager.m5
1 files changed, 5 insertions, 0 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m
index b08abc343..29a6f7a6d 100644
--- a/SmartDeviceLink/SDLLifecycleManager.m
+++ b/SmartDeviceLink/SDLLifecycleManager.m
@@ -112,6 +112,11 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready";
}
- (void)startWithReadyHandler:(SDLManagerReadyBlock)readyHandler {
+ if (![self.lifecycleStateMachine isCurrentState:SDLLifecycleStateStopped]) {
+ [SDLDebugTool logFormat:@"Warning: SDL has already been started, this attempt will be ignored."];
+ return;
+ }
+
self.readyHandler = [readyHandler copy];
[self.lifecycleStateMachine transitionToState:SDLLifecycleStateStarted];