diff options
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 5 |
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]; |