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:
@@ -28,8 +28,6 @@ struct CrtCommandLineArgs
|
|||||||
static void set(int argc, char *argv[], char *envp[]);
|
static void set(int argc, char *argv[], char *envp[]);
|
||||||
};
|
};
|
||||||
|
|
||||||
void initializeSalmanoff(void);
|
|
||||||
|
|
||||||
} // namespace smo
|
} // namespace smo
|
||||||
|
|
||||||
#endif // _MARIONETTE_H
|
#endif // _MARIONETTE_H
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef _SALMANOFF_H
|
||||||
|
#define _SALMANOFF_H
|
||||||
|
|
||||||
|
namespace smo {
|
||||||
|
|
||||||
|
void initializeSalmanoff(void);
|
||||||
|
void shutdownSalmanoff(void);
|
||||||
|
|
||||||
|
} // namespace smo
|
||||||
|
|
||||||
|
#endif // _SALMANOFF_H
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
#include <mind.h>
|
#include <mind.h>
|
||||||
#include <componentThread.h>
|
#include <componentThread.h>
|
||||||
#include <marionette/marionette.h>
|
#include <marionette/marionette.h>
|
||||||
|
#include <salmanoff.h>
|
||||||
|
|
||||||
namespace smo {
|
namespace smo {
|
||||||
|
|
||||||
@@ -104,6 +105,7 @@ void ComponentThread::marionetteMain(ComponentThread& self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::cout << __func__ << ": Exited event loop" << "\n";
|
std::cout << __func__ << ": Exited event loop" << "\n";
|
||||||
|
shutdownSalmanoff();
|
||||||
}
|
}
|
||||||
catch (const std::exception& e)
|
catch (const std::exception& e)
|
||||||
{
|
{
|
||||||
@@ -122,5 +124,4 @@ void ComponentThread::marionetteMain(ComponentThread& self)
|
|||||||
std::cout << __func__ << ": Exiting normally" << std::endl;
|
std::cout << __func__ << ": Exiting normally" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace smo
|
} // namespace smo
|
||||||
|
|||||||
@@ -23,4 +23,14 @@ std::cerr << "Done attachAllSenseDevicesFromSpecs" << std::endl;
|
|||||||
std::cout << __func__ << ": Done." << 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
|
} // namespace smo
|
||||||
|
|||||||
Reference in New Issue
Block a user