summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcollin <collin+i@collinmcqueen.com>2022-01-18 13:03:43 -0500
committercollin <collin+i@collinmcqueen.com>2022-01-18 13:03:43 -0500
commit412f50c7bf9c4fe4119f99e7667989d311028577 (patch)
treefe333e332e975cf6a325b5f3d3cb7c1e500bb31e
parentf9618b7c0d25e378124cb96a5dfb615fb8120699 (diff)
downloadsdl_core-fix/stream_memleak_452.tar.gz
destroy DeviceAppsLauncherImpl ptr impl_ when parent DeviceAppsLauncher is destroyedfix/stream_memleak_452
-rw-r--r--src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h3
-rw-r--r--src/components/application_manager/src/app_launch/device_apps_launcher.cc6
2 files changed, 8 insertions, 1 deletions
diff --git a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
index f1f29471e6..ad103790a8 100644
--- a/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
+++ b/src/components/application_manager/include/application_manager/app_launch/device_apps_launcher.h
@@ -25,6 +25,7 @@ class DeviceAppsLauncher {
DeviceAppsLauncher(application_manager::ApplicationManager& app_mngr,
app_launch::AppsLauncher& apps_launcher,
const AppLaunchSettings& settings);
+ ~DeviceAppsLauncher();
bool LaunchAppsOnDevice(
const std::string& device_mac,
@@ -36,7 +37,7 @@ class DeviceAppsLauncher {
private:
application_manager::ApplicationManager& app_mngr_;
const AppLaunchSettings& settings_;
- std::auto_ptr<DeviceAppsLauncherImpl> impl_;
+ DeviceAppsLauncherImpl* impl_;
friend class DeviceAppsLauncherImpl;
DISALLOW_COPY_AND_ASSIGN(DeviceAppsLauncher);
};
diff --git a/src/components/application_manager/src/app_launch/device_apps_launcher.cc b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
index 0eb9245cf8..bb269e70bf 100644
--- a/src/components/application_manager/src/app_launch/device_apps_launcher.cc
+++ b/src/components/application_manager/src/app_launch/device_apps_launcher.cc
@@ -196,6 +196,12 @@ DeviceAppsLauncher::DeviceAppsLauncher(
, settings_(settings)
, impl_(new DeviceAppsLauncherImpl(*this, apps_launcher)) {}
+
+DeviceAppsLauncher::~DeviceAppsLauncher() {
+ delete impl_;
+ impl_ = nullptr;
+}
+
bool DeviceAppsLauncher::StopLaunchingAppsOnDevice(
const std::string& device_mac) {
return impl_->StopLaunchingAppsOnDevice(device_mac);