summaryrefslogtreecommitdiff
path: root/AudioManagerDaemon/src
diff options
context:
space:
mode:
authorchristian linke <christian.linke@bmw.de>2012-10-12 16:49:34 +0200
committerchristian linke <christian.linke@bmw.de>2012-10-12 16:49:34 +0200
commitc170f0547cd8d4f1a48de807e34269857563b136 (patch)
treef14562570b09a734ed7c498b765b574573c74f5d /AudioManagerDaemon/src
parentbeec2584c3bff46ae7aa0bf57389fb6dadf33917 (diff)
downloadaudiomanager-c170f0547cd8d4f1a48de807e34269857563b136.tar.gz
* Call ControlRundown on receiving SIGTERM.
Signed-off-by: christian linke <christian.linke@bmw.de>
Diffstat (limited to 'AudioManagerDaemon/src')
-rw-r--r--AudioManagerDaemon/src/CAmControlSender.cpp3
-rwxr-xr-xAudioManagerDaemon/src/main.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/AudioManagerDaemon/src/CAmControlSender.cpp b/AudioManagerDaemon/src/CAmControlSender.cpp
index 77cec9f..82446ce 100644
--- a/AudioManagerDaemon/src/CAmControlSender.cpp
+++ b/AudioManagerDaemon/src/CAmControlSender.cpp
@@ -34,6 +34,8 @@ namespace am
#define REQUIRED_INTERFACE_VERSION_MAJOR 1 //!< major interface version. All versions smaller than this will be rejected
#define REQUIRED_INTERFACE_VERSION_MINOR 0 //!< minor interface version. All versions smaller than this will be rejected
+CAmControlSender* CAmControlSender::mInstance=NULL;
+
CAmControlSender::CAmControlSender(std::string controlPluginFile) :
mlibHandle(NULL), //
mController(NULL)
@@ -45,6 +47,7 @@ CAmControlSender::CAmControlSender(std::string controlPluginFile) :
}
else if (!controlPluginFile.empty())
{
+ mInstance=this;
IAmControlSend* (*createFunc)();
createFunc = getCreateFunction<IAmControlSend*()>(controlPluginFile, mlibHandle);
assert(createFunc!=NULL);
diff --git a/AudioManagerDaemon/src/main.cpp b/AudioManagerDaemon/src/main.cpp
index b9eade1..b5eed1c 100755
--- a/AudioManagerDaemon/src/main.cpp
+++ b/AudioManagerDaemon/src/main.cpp
@@ -267,7 +267,10 @@ static void signalHandler(int sig, siginfo_t *siginfo, void *context)
logError("signal handler was called, exit now...");
gDispatchDone = 1;
//todo: maually fire the mainloop
- exit(1);
+ CAmControlSender::CallsetControllerRundown();
+
+ //todo: Maybe we can remove this here in a productive system. For now it's handy :-)
+ exit (-1);
}
void mainProgram()