From c170f0547cd8d4f1a48de807e34269857563b136 Mon Sep 17 00:00:00 2001 From: christian linke Date: Fri, 12 Oct 2012 16:49:34 +0200 Subject: * Call ControlRundown on receiving SIGTERM. Signed-off-by: christian linke --- AudioManagerDaemon/src/CAmControlSender.cpp | 3 +++ AudioManagerDaemon/src/main.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'AudioManagerDaemon/src') 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(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() -- cgit v1.2.1