From 4fd217a1c6d149a826b7d6d09661d32cfecb6454 Mon Sep 17 00:00:00 2001 From: Ching Tzung Lin Date: Thu, 23 Jul 2015 10:18:06 -0700 Subject: Fix compilation error on emerald-dev Change-Id: I324fb9b1b54e31610fe4fdce8edbb6979e666cbb --- modules/sensors/multihal.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules') diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp index cd67f6d..d26d168 100644 --- a/modules/sensors/multihal.cpp +++ b/modules/sensors/multihal.cpp @@ -34,6 +34,8 @@ #include #include +#include +#include static const char* CONFIG_FILENAME = "/system/etc/sensors/hals.conf"; static const char* LEGAL_SUBHAL_PATH_PREFIX = "/system/lib/hw/"; -- cgit v1.1 From 7659cdd34d33498b3e172730a888f8ea793e1ef3 Mon Sep 17 00:00:00 2001 From: Dhruva Krishnamurthy Date: Tue, 30 Aug 2016 06:45:14 -0700 Subject: Memory leak fix during sensor HAL initialization Change-Id: If8833dd1285f33498277c10b0e1fd0a1269284a0 --- modules/sensors/multihal.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/sensors/multihal.cpp b/modules/sensors/multihal.cpp index 8330ff3..48f2be3 100644 --- a/modules/sensors/multihal.cpp +++ b/modules/sensors/multihal.cpp @@ -490,14 +490,14 @@ static void lazy_init_modules() { pthread_mutex_unlock(&init_modules_mutex); return; } - std::vector *so_paths = new std::vector(); - get_so_paths(so_paths); + std::vector so_paths; + get_so_paths(&so_paths); // dlopen the module files and cache their module symbols in sub_hw_modules sub_hw_modules = new std::vector(); dlerror(); // clear any old errors const char* sym = HAL_MODULE_INFO_SYM_AS_STR; - for (std::vector::iterator it = so_paths->begin(); it != so_paths->end(); it++) { + for (std::vector::iterator it = so_paths.begin(); it != so_paths.end(); it++) { const char* path = it->c_str(); void* lib_handle = dlopen(path, RTLD_LAZY); if (lib_handle == NULL) { -- cgit v1.1