summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMuller, Alexander (A.) <amulle19@ford.com>2017-03-01 12:29:25 -0800
committerMuller, Alexander (A.) <amulle19@ford.com>2017-03-01 12:29:25 -0800
commitbf23cb383e886300008777baa3a2756ce271506d (patch)
tree9ff8add0a7ef48ff95048d2264803ccfce3a34fc
parent1109f73e492a593c1d1c53ed6d19999c5e5f16f3 (diff)
downloadsdl_ios-bf23cb383e886300008777baa3a2756ce271506d.tar.gz
Added check for starting a lifecycle manager that has already been started.
-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];