diff --git a/smocore/include/marionette/marionette.h b/smocore/include/marionette/marionette.h index 50b3a23..af1332c 100644 --- a/smocore/include/marionette/marionette.h +++ b/smocore/include/marionette/marionette.h @@ -28,8 +28,6 @@ struct CrtCommandLineArgs static void set(int argc, char *argv[], char *envp[]); }; -void initializeSalmanoff(void); - } // namespace smo #endif // _MARIONETTE_H diff --git a/smocore/include/salmanoff.h b/smocore/include/salmanoff.h new file mode 100644 index 0000000..703a095 --- /dev/null +++ b/smocore/include/salmanoff.h @@ -0,0 +1,11 @@ +#ifndef _SALMANOFF_H +#define _SALMANOFF_H + +namespace smo { + +void initializeSalmanoff(void); +void shutdownSalmanoff(void); + +} // namespace smo + +#endif // _SALMANOFF_H diff --git a/smocore/marionette/marionette.cpp b/smocore/marionette/marionette.cpp index d815622..39baa0c 100644 --- a/smocore/marionette/marionette.cpp +++ b/smocore/marionette/marionette.cpp @@ -6,6 +6,7 @@ #include #include #include +#include namespace smo { @@ -104,6 +105,7 @@ void ComponentThread::marionetteMain(ComponentThread& self) } std::cout << __func__ << ": Exited event loop" << "\n"; + shutdownSalmanoff(); } catch (const std::exception& e) { @@ -122,5 +124,4 @@ void ComponentThread::marionetteMain(ComponentThread& self) std::cout << __func__ << ": Exiting normally" << std::endl; } - } // namespace smo diff --git a/smocore/marionette/salmanoff.cpp b/smocore/marionette/salmanoff.cpp index 1434c83..1e951a2 100644 --- a/smocore/marionette/salmanoff.cpp +++ b/smocore/marionette/salmanoff.cpp @@ -23,4 +23,14 @@ std::cerr << "Done attachAllSenseDevicesFromSpecs" << std::endl; std::cout << __func__ << ": Done." << std::endl; } +void shutdownSalmanoff(void) +{ + std::cout << __func__ << ": Entered." << std::endl; + + sense_api::SenseApiManager::getInstance().detachAllSenseDevices(); + sense_api::SenseApiManager::getInstance().finalizeAllSenseApiLibs(); + + std::cout << __func__ << ": Done." << std::endl; +} + } // namespace smo