summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/src/CommandSender.cpp
diff options
context:
space:
mode:
authorChristian Mueller <christian@lmuc329619u.(none)>2011-12-12 21:43:47 +0100
committerChristian Mueller <christian@lmuc329619u.(none)>2011-12-12 21:43:47 +0100
commit205595e3d3e6a1d55be3c462ef02c9f828a77feb (patch)
tree9c1202619c7b9a66ed874ca1a0c81530ae06e426 /AudioManagerDaemon/src/CommandSender.cpp
parentd85e69bbf6d8ec6e087c7af579686923c76079cd (diff)
downloadaudiomanager-205595e3d3e6a1d55be3c462ef02c9f828a77feb.tar.gz
some updates, new tests
Diffstat (limited to 'AudioManagerDaemon/src/CommandSender.cpp')
-rw-r--r--AudioManagerDaemon/src/CommandSender.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/AudioManagerDaemon/src/CommandSender.cpp b/AudioManagerDaemon/src/CommandSender.cpp
index 113ea2b..841c520 100644
--- a/AudioManagerDaemon/src/CommandSender.cpp
+++ b/AudioManagerDaemon/src/CommandSender.cpp
@@ -8,12 +8,13 @@
#include "CommandSender.h"
#include "command/CommandSendInterface.h"
#include "pluginTemplate.h"
+
using namespace am;
#define CALL_ALL_INTERFACES(...) \
std::vector<CommandSendInterface*>::iterator iter = mListInterfaces.begin(); \
std::vector<CommandSendInterface*>::iterator iterEnd = mListInterfaces.end(); \
- for (; iter<iterEnd;++iter) \
+ for (; iter<iterEnd;++iter) \
{ \
(*iter)->__VA_ARGS__; \
}
@@ -23,6 +24,8 @@ const char* commandPluginDirectories[] = { "/home/christian/workspace/gitserver/
uint16_t commandPluginDirectoriesCount = sizeof(commandPluginDirectories) / sizeof(commandPluginDirectories[0]);
CommandSender::CommandSender()
+ :mListInterfaces(),
+ mListLibraryHandles()
{
std::vector<std::string> sharedLibraryNameList;
@@ -71,7 +74,8 @@ CommandSender::CommandSender()
{
//DLT_LOG(AudioManager,DLT_LOG_INFO, DLT_STRING("Loading Hook plugin"),DLT_STRING(iter->c_str()));
CommandSendInterface* (*createFunc)();
- createFunc = getCreateFunction<CommandSendInterface*()>(*iter);
+ void* tempLibHandle=NULL;
+ createFunc = getCreateFunction<CommandSendInterface*()>(*iter,tempLibHandle);
if (!createFunc)
{
@@ -88,11 +92,13 @@ CommandSender::CommandSender()
}
mListInterfaces.push_back(commander);
+ mListLibraryHandles.push_back(tempLibHandle);
}
}
CommandSender::~CommandSender()
{
+ unloadLibraries();
}
@@ -229,5 +235,17 @@ void CommandSender::cbTimingInformationChanged(const am_mainConnectionID_t mainC
CALL_ALL_INTERFACES(cbTimingInformationChanged(mainConnection,time))
}
+void CommandSender::unloadLibraries(void)
+{
+ std::vector<void*>::iterator iterator=mListLibraryHandles.begin();
+ for(;iterator<mListLibraryHandles.end();++iterator)
+ {
+ dlclose(*iterator);
+ }
+ mListLibraryHandles.clear();
+}
+
+
+