diff options
author | Shobhit Adlakha <ShobhitAd@users.noreply.github.com> | 2022-10-26 11:34:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 11:34:13 -0400 |
commit | 7343fc72c12edc8ac42a62556c9e4b29c9408bc3 (patch) | |
tree | 32e910f5440c10b384bb26b5555ac7adb77540ee /src/components/application_manager/src/resumption/resumption_data_processor_impl.cc | |
parent | 65947fd1eb30a392948d67003df0fe803c070c6b (diff) | |
parent | fb05c085b449b2149f85338fd4d00951205ab969 (diff) | |
download | sdl_core-7343fc72c12edc8ac42a62556c9e4b29c9408bc3.tar.gz |
Release 8.2.0
Diffstat (limited to 'src/components/application_manager/src/resumption/resumption_data_processor_impl.cc')
-rw-r--r-- | src/components/application_manager/src/resumption/resumption_data_processor_impl.cc | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/components/application_manager/src/resumption/resumption_data_processor_impl.cc b/src/components/application_manager/src/resumption/resumption_data_processor_impl.cc index b8462a533a..996b4f3026 100644 --- a/src/components/application_manager/src/resumption/resumption_data_processor_impl.cc +++ b/src/components/application_manager/src/resumption/resumption_data_processor_impl.cc @@ -178,7 +178,7 @@ void ResumptionDataProcessorImpl::ProcessResumptionStatus( } } -void ResumptionDataProcessorImpl::EraseProcessedRequest( +bool ResumptionDataProcessorImpl::EraseProcessedRequest( const uint32_t app_id, const ResumptionRequest& found_request) { SDL_LOG_AUTO_TRACE(); @@ -194,7 +194,11 @@ void ResumptionDataProcessorImpl::EraseProcessedRequest( request.request_id.function_id == found_request.request_id.function_id; }); - list_of_sent_requests.erase(request_iter); + if (request_iter != list_of_sent_requests.end()) { + list_of_sent_requests.erase(request_iter); + return true; + } + return false; } bool ResumptionDataProcessorImpl::IsResumptionFinished( @@ -285,6 +289,7 @@ void ResumptionDataProcessorImpl::ProcessResponseFromHMI( SDL_LOG_DEBUG("app_id is: " << app_id); auto found_request = GetRequest(app_id, function_id, corr_id); + if (!found_request) { SDL_LOG_ERROR("Request with function id " << function_id << " and corr id " << corr_id << " not found"); @@ -293,7 +298,11 @@ void ResumptionDataProcessorImpl::ProcessResponseFromHMI( auto request = *found_request; ProcessResumptionStatus(app_id, response, request); - EraseProcessedRequest(app_id, request); + + if (!EraseProcessedRequest(app_id, request)) { + SDL_LOG_DEBUG("Request has already been processed"); + return; + } if (!IsResumptionFinished(app_id)) { SDL_LOG_DEBUG("Resumption app " @@ -890,7 +899,8 @@ void ResumptionDataProcessorImpl::AddPluginsSubscriptions( const smart_objects::SmartObject& saved_app) { SDL_LOG_AUTO_TRACE(); - for (auto& extension : application->Extensions()) { + auto extensions = application->Extensions(); + for (auto& extension : extensions.GetData()) { extension->ProcessResumption(saved_app); } } @@ -995,7 +1005,7 @@ void ResumptionDataProcessorImpl::DeletePluginsSubscriptions( resumption_status_lock_.Release(); auto extensions = application->Extensions(); - for (auto& extension : extensions) { + for (auto& extension : extensions.GetData()) { extension->RevertResumption(resumption_data_to_revert); } } |