aboutsummaryrefslogtreecommitdiffstats
path: root/parameter
diff options
context:
space:
mode:
Diffstat (limited to 'parameter')
-rw-r--r--parameter/ParameterMgr.cpp12
-rw-r--r--parameter/ParameterMgr.h3
-rw-r--r--parameter/SystemClass.cpp10
-rw-r--r--parameter/SystemClass.h1
4 files changed, 23 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) {
diff --git a/parameter/ParameterMgr.h b/parameter/ParameterMgr.h
index 1f738fe..d152a85 100644
--- a/parameter/ParameterMgr.h
+++ b/parameter/ParameterMgr.h
@@ -466,6 +466,9 @@ private:
// Subsystem plugin location
const CSubsystemPlugins* _pSubsystemPlugins;
+ // Remote processor library handle
+ void *_handleLibRemoteProcessor;
+
// Whole system structure checksum
uint8_t _uiStructureChecksum;
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);
diff --git a/parameter/SystemClass.h b/parameter/SystemClass.h
index ee71e5f..37d270a 100644
--- a/parameter/SystemClass.h
+++ b/parameter/SystemClass.h
@@ -105,5 +105,6 @@ private:
// Subsystem factory
CSubsystemLibrary* _pSubsystemLibrary;
+ list<void*> _subsystemLibraries; /**< Contains the list of all open plugin libs. */
};