summaryrefslogtreecommitdiff
path: root/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
diff options
context:
space:
mode:
authorYana Chernysheva (GitHub) <59469418+ychernysheva@users.noreply.github.com>2022-01-19 18:21:43 +0200
committerGitHub <noreply@github.com>2022-01-19 11:21:43 -0500
commitf6d2ff1cd90dd2dcb2b4fd4f5ca11224e13229ae (patch)
tree41c3a503b1265853c3a4ffadcf53aaf31fe118bb /src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
parent880f4bb2e3ea048f070917077230c3bb832b999c (diff)
downloadsdl_core-f6d2ff1cd90dd2dcb2b4fd4f5ca11224e13229ae.tar.gz
Move app launcher stop before unregister app (#3825)
* Move app launcher stop before unregister app The applauncher has to be stopped before appropriate application will be unregistered. Otherwise it could lead to core crash, when Launch controller will try to run already non existed application Co-authored-by: Andrii Kalinich <AKalinich@luxoft.com> Co-authored-by: OlhaVorobiova <olha.vorobiova@dxc.com> Co-authored-by: VladSemenyuk <vsemenyuk@luxoft.com>
Diffstat (limited to 'src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc')
-rw-r--r--src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
index 4dafe9a8e6..05231b66b1 100644
--- a/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
+++ b/src/components/application_manager/src/app_launch/app_launch_ctrl_impl.cc
@@ -83,6 +83,7 @@ bool HmiLevelSorter(const std::pair<int32_t, ApplicationDataPtr>& lval,
void AppLaunchCtrlImpl::OnDeviceConnected(const std::string& device_mac) {
SDL_LOG_AUTO_TRACE();
+
std::vector<ApplicationDataPtr> apps_on_device =
app_launch_data_.GetApplicationDataByDevice(device_mac);
std::vector<std::pair<int32_t, ApplicationDataPtr> > apps_hmi_levels;
@@ -102,6 +103,7 @@ void AppLaunchCtrlImpl::OnDeviceConnected(const std::string& device_mac) {
std::back_inserter(apps_on_device),
GetAppFromHmiLevelPair);
if (apps_on_device.size() > 0) {
+ sync_primitives::AutoLock lock(device_apps_launcher_lock_);
device_apps_launcher_.LaunchAppsOnDevice(device_mac, apps_on_device);
} else {
SDL_LOG_DEBUG("No apps in saved for device " << device_mac);
@@ -112,4 +114,11 @@ void AppLaunchCtrlImpl::OnMasterReset() {
SDL_LOG_AUTO_TRACE();
app_launch_data_.Clear();
}
+
+void AppLaunchCtrlImpl::Stop() {
+ SDL_LOG_AUTO_TRACE();
+ sync_primitives::AutoLock lock(device_apps_launcher_lock_);
+ device_apps_launcher_.StopLaunchingAppsOnAllDevices();
+}
+
} // namespace app_launch