diff options
author | Renaud de Chivre <renaud.de.chivre@intel.com> | 2013-12-13 15:09:44 +0100 |
---|---|---|
committer | David Wagner <david.wagner@intel.com> | 2014-02-12 17:04:16 +0100 |
commit | 1b8b3ca093ecd7dc8c1877352625508ca4a81728 (patch) | |
tree | 48a877768c33d4f3812384d4e7d356db8d1626f4 /parameter/ParameterMgr.cpp | |
parent | 3e783c2172a05bf5557086301442e7b56aba78a2 (diff) | |
download | external_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/ParameterMgr.cpp')
-rw-r--r-- | parameter/ParameterMgr.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/parameter/ParameterMgr.cpp b/parameter/ParameterMgr.cpp index a07cc57..88270c5 100644 --- a/parameter/ParameterMgr.cpp +++ b/parameter/ParameterMgr.cpp @@ -276,6 +276,7 @@ CParameterMgr::CParameterMgr(const string& strConfigurationFilePath) : _pElementLibrarySet(new CElementLibrarySet), _strXmlConfigurationFilePath(strConfigurationFilePath), _pSubsystemPlugins(NULL), + _handleLibRemoteProcessor(NULL), _uiStructureChecksum(0), _pRemoteProcessorServer(NULL), _uiMaxCommandUsageLength(0), @@ -332,6 +333,11 @@ CParameterMgr::~CParameterMgr() delete _pMainParameterBlackboard; delete _pElementLibrarySet; + // Close remote processor library + if (_handleLibRemoteProcessor != NULL) { + dlclose(_handleLibRemoteProcessor); + } + // Tuning Mode Mutex pthread_mutex_destroy(&_blackboardMutex); } @@ -2195,9 +2201,9 @@ bool CParameterMgr::handleRemoteProcessingInterface(string& strError) log_info("Loading remote processor library"); // Load library - void* lib_handle = dlopen("libremote-processor.so", RTLD_NOW); + _handleLibRemoteProcessor = dlopen("libremote-processor.so", RTLD_NOW); - if (!lib_handle) { + if (!_handleLibRemoteProcessor) { // Return error const char* pcError = dlerror(); @@ -2213,7 +2219,7 @@ bool CParameterMgr::handleRemoteProcessingInterface(string& strError) return false; } - CreateRemoteProcessorServer pfnCreateRemoteProcessorServer = (CreateRemoteProcessorServer)dlsym(lib_handle, "createRemoteProcessorServer"); + CreateRemoteProcessorServer pfnCreateRemoteProcessorServer = (CreateRemoteProcessorServer)dlsym(_handleLibRemoteProcessor, "createRemoteProcessorServer"); if (!pfnCreateRemoteProcessorServer) { |