diff options
author | Collin <iCollin@users.noreply.github.com> | 2021-09-08 14:47:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 14:47:15 -0400 |
commit | 8996e9796ead4c8f51a1967f34ec6631089c528f (patch) | |
tree | 507875d0f53ccb95cfc6974925f2e6c975b848d3 | |
parent | d564f2177cb7092aaed3eb41f584f58b2b5fade8 (diff) | |
download | sdl_core-fix/erase_hmi_begin_state.tar.gz |
Apply suggestions from code reviewfix/erase_hmi_begin_state
Co-authored-by: Jacob Keeler <jacob.keeler@livioradio.com>
-rw-r--r-- | src/components/application_manager/src/application_state.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/components/application_manager/src/application_state.cc b/src/components/application_manager/src/application_state.cc index f565ce2306..ee43d32b0a 100644 --- a/src/components/application_manager/src/application_state.cc +++ b/src/components/application_manager/src/application_state.cc @@ -204,11 +204,12 @@ void ApplicationState::RemoveHMIState(const WindowID window_id, void ApplicationState::EraseHMIState(HmiStates& hmi_states, HmiStates::iterator it) { - if (hmi_states.begin() == it && hmi_states.size() > 1) { + if (hmi_states.begin() == it) { HmiStates::iterator next = it; ++next; - if (*next && (*next)->parent() == *it) { - (*next)->set_parent(nullptr); + if (hmi_states.end() != next) { + HmiStatePtr next_state = *next; + next_state->set_parent(nullptr); } } else { HmiStates::iterator next = it; |