diff options
author | Alexander Kutsan (GitHub) <akutsan@luxoft.com> | 2020-08-31 16:14:58 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-31 09:14:58 -0400 |
commit | 79fb6408810d776278bf3499c5273eb04159b076 (patch) | |
tree | a0e860d51b2712afef8b9ff113000436011e33e3 /src/components/application_manager/src/request_info.cc | |
parent | 979492b415698d1bba26efbfd5d9ee08bbb01147 (diff) | |
download | sdl_core-79fb6408810d776278bf3499c5273eb04159b076.tar.gz |
Fix SIGKILL due to not clearing the requestinfo set. (#3376)
* SDLCORE-666: Fix SIGKILL due to not clearing the requestinfo set.
SDLCORE-666
Added RequestInfoSet Destructor for properly clearing the time_sorted_pending_requests_ set
to avoid double release of the same while destroying the RequestController Object.
* Update fix for SIGKILL due to not clearing the requestinfo set
- Change the RemoveRequest method on the Erase method in the RequestInfoSet
destructor;
- Remove redundant TestRequestsInfo collection in the Unit test
Co-authored-by: Sidhartha <ssing314@ford.com>
Co-authored-by: Igor Gapchuk <igapchuck@luxoft.com>
Co-authored-by: Dmitriy Boltovskiy <dboltovskyi@luxoft.com>
Diffstat (limited to 'src/components/application_manager/src/request_info.cc')
-rw-r--r-- | src/components/application_manager/src/request_info.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/components/application_manager/src/request_info.cc b/src/components/application_manager/src/request_info.cc index 4f1e0a8f07..b6f53b6085 100644 --- a/src/components/application_manager/src/request_info.cc +++ b/src/components/application_manager/src/request_info.cc @@ -116,6 +116,15 @@ FakeRequestInfo::FakeRequestInfo(uint32_t app_id, uint32_t correaltion_id) { correlation_id_ = correaltion_id; } +RequestInfoSet::~RequestInfoSet() { + sync_primitives::AutoLock lock(pending_requests_lock_); + auto it = time_sorted_pending_requests_.begin(); + while (!time_sorted_pending_requests_.empty()) { + Erase(*it); + it = time_sorted_pending_requests_.begin(); + } +} + bool RequestInfoSet::Add(RequestInfoPtr request_info) { DCHECK_OR_RETURN(request_info, false); LOG4CXX_DEBUG( |