Mrntt: Call shutdownSalmanoff after exiting main loop
We moved initializeSalmanoff and shutdownSalmanoff into salmanoff.cpp. Now we also invoke shutdownSalmanoff when exiting to destroy subsystems and components gracefully. This fixes the segfault that was thrown on every program exit when xcbWindow had captured a window.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <mind.h>
|
||||
#include <componentThread.h>
|
||||
#include <marionette/marionette.h>
|
||||
#include <salmanoff.h>
|
||||
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user