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:
2025-07-30 10:07:52 -04:00
parent e276fcbdce
commit 4fde28dad8
4 changed files with 23 additions and 3 deletions
+2 -1
View File
@@ -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
+10
View File
@@ -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