summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Keeler <jacob.keeler@livioradio.com>2020-07-29 16:35:32 -0400
committerGitHub <noreply@github.com>2020-07-29 16:35:32 -0400
commit6560d0222ac7e35f1082a67783acc3c9f8689b5e (patch)
tree53b7b66704716224f3b08c12a884230f490b232c
parentf2119f4b997b7ef8d3d8f771412e1e743c221713 (diff)
parente98aff7471585813c3088007332d0fb772dfed7d (diff)
downloadsdl_core-6560d0222ac7e35f1082a67783acc3c9f8689b5e.tar.gz
Merge pull request #3347 from smartdevicelink/fix/fix_button_subscriptions_mutex_deadlock
Fix mutex deadlock around app button subscriptions
-rw-r--r--src/components/application_manager/src/message_helper/message_helper.cc3
-rw-r--r--src/components/application_manager/src/resumption/resumption_data.cc19
2 files changed, 12 insertions, 10 deletions
diff --git a/src/components/application_manager/src/message_helper/message_helper.cc b/src/components/application_manager/src/message_helper/message_helper.cc
index d6fbed115b..2afecf037a 100644
--- a/src/components/application_manager/src/message_helper/message_helper.cc
+++ b/src/components/application_manager/src/message_helper/message_helper.cc
@@ -1108,8 +1108,7 @@ void MessageHelper::SendAllOnButtonSubscriptionNotificationsForApp(
return;
}
- DataAccessor<ButtonSubscriptions> button_accessor = app->SubscribedButtons();
- ButtonSubscriptions subscriptions = button_accessor.GetData();
+ const ButtonSubscriptions subscriptions = app->SubscribedButtons().GetData();
ButtonSubscriptions::iterator it = subscriptions.begin();
for (; subscriptions.end() != it; ++it) {
SendOnButtonSubscriptionNotification(
diff --git a/src/components/application_manager/src/resumption/resumption_data.cc b/src/components/application_manager/src/resumption/resumption_data.cc
index 9046fe35ad..0312975fec 100644
--- a/src/components/application_manager/src/resumption/resumption_data.cc
+++ b/src/components/application_manager/src/resumption/resumption_data.cc
@@ -148,20 +148,23 @@ smart_objects::SmartObject ResumptionData::GetApplicationSubscriptions(
}
LOG4CXX_DEBUG(logger_, "app_id:" << application->app_id());
- DataAccessor<ButtonSubscriptions> button_accessor =
- application->SubscribedButtons();
+ {
+ DataAccessor<ButtonSubscriptions> button_accessor =
+ application->SubscribedButtons();
- const ButtonSubscriptions& button_subscriptions = button_accessor.GetData();
+ const ButtonSubscriptions& button_subscriptions = button_accessor.GetData();
- LOG4CXX_DEBUG(logger_, "SubscribedButtons:" << button_subscriptions.size());
- Append(button_subscriptions.begin(),
- button_subscriptions.end(),
- strings::application_buttons,
- subscriptions);
+ LOG4CXX_DEBUG(logger_, "SubscribedButtons:" << button_subscriptions.size());
+ Append(button_subscriptions.begin(),
+ button_subscriptions.end(),
+ strings::application_buttons,
+ subscriptions);
+ }
for (auto extension : application->Extensions()) {
extension->SaveResumptionData(subscriptions);
}
+
return subscriptions;
}