diff --git a/src/components/application_manager/src/policies/policy_handler.cc b/src/components/application_manager/src/policies/policy_handler.cc index 678916f7eb7..48eb62187fc 100644 --- a/src/components/application_manager/src/policies/policy_handler.cc +++ b/src/components/application_manager/src/policies/policy_handler.cc @@ -1308,18 +1308,22 @@ void PolicyHandler::OnAllowSDLFunctionalityNotification( #ifdef EXTERNAL_PROPRIETARY_MODE - DataAccessor accessor = - application_manager_.applications(); + ApplicationSet applications; + { + DataAccessor accessor = + application_manager_.applications(); + applications = accessor.GetData(); + } if (!is_allowed) { std::for_each( - accessor.GetData().begin(), - accessor.GetData().end(), + applications.begin(), + applications.end(), DeactivateApplication(device_handle, application_manager_.state_controller())); } else { std::for_each( - accessor.GetData().begin(), - accessor.GetData().end(), + applications.begin(), + applications.end(), SDLAlowedNotification(device_handle, policy_manager_.get(), application_manager_.state_controller()));