diff options
author | JackLivio <jack@livio.io> | 2019-01-23 09:41:00 -0500 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2019-01-23 09:41:00 -0500 |
commit | 5676f89293d1e5a1a95c06a714072564138a47c4 (patch) | |
tree | 24bec23ca3fd01c4e8a37ac567d2c3f63d327697 | |
parent | 2919256b27889639ce4daa74a9f1e75bf1f25111 (diff) | |
download | sdl_core-feature/cloud_app_connection_status_disconnect.tar.gz |
Add pending device map locksfeature/cloud_app_connection_status_disconnect
-rw-r--r-- | src/components/application_manager/src/application_manager_impl.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/components/application_manager/src/application_manager_impl.cc b/src/components/application_manager/src/application_manager_impl.cc index 475dff895b..7b2475a4e0 100644 --- a/src/components/application_manager/src/application_manager_impl.cc +++ b/src/components/application_manager/src/application_manager_impl.cc @@ -911,6 +911,7 @@ void ApplicationManagerImpl::CreatePendingApplication( pending_device_map_lock_ptr_->Acquire(); auto it = pending_device_map_.find(name); if (it == pending_device_map_.end()) { + pending_device_map_lock_ptr_->Release(); return; } pending_device_map_lock_ptr_->Release(); @@ -992,10 +993,13 @@ void ApplicationManagerImpl::SetPendingApplicationState( const transport_manager::ConnectionUID connection_id, const transport_manager::DeviceInfo& device_info) { std::string name = device_info.name(); + pending_device_map_lock_ptr_->Acquire(); auto it = pending_device_map_.find(name); if (it == pending_device_map_.end()) { + pending_device_map_lock_ptr_->Release(); return; } + pending_device_map_lock_ptr_->Release(); const std::string policy_app_id = it->second; auto app = application_by_policy_id(policy_app_id); |