diff options
Diffstat (limited to 'SmartDeviceLink/SDLStateMachine.m')
-rw-r--r-- | SmartDeviceLink/SDLStateMachine.m | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/SmartDeviceLink/SDLStateMachine.m b/SmartDeviceLink/SDLStateMachine.m index f86a002b2..cc34d99e2 100644 --- a/SmartDeviceLink/SDLStateMachine.m +++ b/SmartDeviceLink/SDLStateMachine.m @@ -117,10 +117,11 @@ SDLStateMachineTransitionFormat const SDLStateMachineTransitionFormatDidEnter = return; } - if (oldState != nil && shouldCall) { + if (oldState != nil) { self.currentState = oldState; - [self transitionToState:state]; - } else if (shouldCall) { + } + + if (shouldCall) { SEL didEnter = NSSelectorFromString([NSString stringWithFormat:SDLStateMachineTransitionFormatDidEnter, state]); #pragma clang diagnostic push #pragma clang diagnostic ignored "-Warc-performSelector-leaks" @@ -128,9 +129,9 @@ SDLStateMachineTransitionFormat const SDLStateMachineTransitionFormatDidEnter = [self.target performSelector:didEnter]; #pragma clang diagnostic pop } - } else { - self.currentState = state; } + + self.currentState = state; } /** |