summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjacobkeeler <jacob.keeler@livioradio.com>2021-01-26 10:14:19 -0500
committerjacobkeeler <jacob.keeler@livioradio.com>2021-01-26 10:14:19 -0500
commit3d28b125b14c988839db9981e432adb3a68389b7 (patch)
tree8123c32b045b36d3cd723a0f4e4abde9d0c9324b
parent70ffbe1cbf843e76e439de95ec0659ddd589e4f2 (diff)
downloadsdl_core-3d28b125b14c988839db9981e432adb3a68389b7.tar.gz
Fix invalid iterators in application helper and rc app extension
-rw-r--r--src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc3
-rw-r--r--src/components/application_manager/src/helpers/application_helper.cc12
2 files changed, 8 insertions, 7 deletions
diff --git a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
index b9d87d74b1..b623350388 100644
--- a/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
+++ b/src/components/application_manager/rpc_plugins/rc_rpc_plugin/src/rc_app_extension.cc
@@ -88,7 +88,8 @@ void RCAppExtension::UnsubscribeFromInteriorVehicleData(
void RCAppExtension::UnsubscribeFromInteriorVehicleDataOfType(
const std::string& module_type) {
bool unsubscribed = false;
- for (auto& item : subscribed_interior_vehicle_data_) {
+ auto subscribed_ivi = subscribed_interior_vehicle_data_;
+ for (auto& item : subscribed_ivi) {
if (module_type == item.first) {
subscribed_interior_vehicle_data_.erase(item);
unsubscribed = true;
diff --git a/src/components/application_manager/src/helpers/application_helper.cc b/src/components/application_manager/src/helpers/application_helper.cc
index c9a0d87aed..74810d7e09 100644
--- a/src/components/application_manager/src/helpers/application_helper.cc
+++ b/src/components/application_manager/src/helpers/application_helper.cc
@@ -23,9 +23,9 @@ void DeleteWayPoints(ApplicationSharedPtr app,
void DeleteCommands(ApplicationSharedPtr app, ApplicationManager& app_manager) {
auto accessor = app->commands_map();
- const auto& commands_map = accessor.GetData();
+ const auto commands_map = accessor.GetData();
- for (const auto& cmd : commands_map) {
+ for (const auto cmd : commands_map) {
auto delete_UI_msg = MessageHelper::CreateDeleteUICommandRequest(
cmd.second, app->app_id(), app_manager.GetNextHMICorrelationID());
app_manager.GetRPCService().ManageHMICommand(delete_UI_msg);
@@ -41,9 +41,9 @@ void DeleteCommands(ApplicationSharedPtr app, ApplicationManager& app_manager) {
void DeleteSubmenus(ApplicationSharedPtr app, ApplicationManager& app_manager) {
auto accessor = app->sub_menu_map();
- const auto& sub_menu_map = accessor.GetData();
+ const auto sub_menu_map = accessor.GetData();
- for (const auto& smenu : sub_menu_map) {
+ for (const auto smenu : sub_menu_map) {
MessageHelper::SendDeleteSubmenuRequest(smenu.second, app, app_manager);
app->RemoveSubMenu(smenu.first);
}
@@ -52,9 +52,9 @@ void DeleteSubmenus(ApplicationSharedPtr app, ApplicationManager& app_manager) {
void DeleteChoiceSets(ApplicationSharedPtr app,
ApplicationManager& app_manager) {
auto accessor = app->choice_set_map();
- const auto& choices = accessor.GetData();
+ const auto choices = accessor.GetData();
- for (const auto& choice : choices) {
+ for (const auto choice : choices) {
MessageHelper::SendDeleteChoiceSetRequest(choice.second, app, app_manager);
app->RemoveChoiceSet(choice.first);
}