summaryrefslogtreecommitdiffstats
path: root/parameter/SystemClass.cpp
diff options
context:
space:
mode:
authorRenaud de Chivre <renaud.de.chivre@intel.com>2013-12-13 15:09:44 +0100
committerDavid Wagner <david.wagner@intel.com>2014-02-12 17:04:16 +0100
commit1b8b3ca093ecd7dc8c1877352625508ca4a81728 (patch)
tree48a877768c33d4f3812384d4e7d356db8d1626f4 /parameter/SystemClass.cpp
parent3e783c2172a05bf5557086301442e7b56aba78a2 (diff)
downloadexternal_parameter-framework-1b8b3ca093ecd7dc8c1877352625508ca4a81728.zip
external_parameter-framework-1b8b3ca093ecd7dc8c1877352625508ca4a81728.tar.gz
external_parameter-framework-1b8b3ca093ecd7dc8c1877352625508ca4a81728.tar.bz2
Close all dynamic libraries when PFW is destroyed
BZ: 159294 The PFW opens many dynamic libs but does not keep any track of them. This prevents to close them cleanly and have border effect when trying to do coverage measurement. The patch ensures that the PFW closes its libraries when destroyed. Change-Id: Idd1f69bfbc719e8e000914bef990c809ec5ed206 Signed-off-by: Renaud de Chivre <renaud.de.chivre@intel.com>
Diffstat (limited to 'parameter/SystemClass.cpp')
-rw-r--r--parameter/SystemClass.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/parameter/SystemClass.cpp b/parameter/SystemClass.cpp
index 14db767..bd87cb2 100644
--- a/parameter/SystemClass.cpp
+++ b/parameter/SystemClass.cpp
@@ -62,6 +62,13 @@ CSystemClass::CSystemClass() : _pSubsystemLibrary(new CSubsystemLibrary)
CSystemClass::~CSystemClass()
{
delete _pSubsystemLibrary;
+
+ // Close all previously opened libraries
+ while (!_subsystemLibraries.empty())
+ {
+ dlclose(_subsystemLibraries.back());
+ _subsystemLibraries.pop_back();
+ }
}
bool CSystemClass::childrenAreDynamic() const
@@ -216,6 +223,9 @@ bool CSystemClass::loadPlugins(list<string>& lstrPluginFiles, list<string>& lstr
continue;
}
+ // Store libraries handles
+ _subsystemLibraries.push_back(lib_handle);
+
// Get plugin symbol
string strPluginSymbol = getPluginSymbol(strPluginFileName);