fix signal handling in ExampleBrowser on linux/mac on termination

expose all analogue axes from OpenVR (5 controllers, each x,y -> 10 floats) in pybullet.getVREvents(allAnalogAxes=1)
This commit is contained in:
erwincoumans
2017-10-05 12:59:58 -07:00
parent 822ff077c7
commit b572fe43f9
8 changed files with 81 additions and 39 deletions

View File

@@ -30,19 +30,16 @@ static OpenGLExampleBrowser* sExampleBrowser=0;
static void cleanup(int signo)
{
if (interrupted) { // this is the second time, we're hanging somewhere
// if (example) {
// example->abort();
// }
if (!interrupted) { // this is the second time, we're hanging somewhere
b3Printf("Aborting and deleting SharedMemoryCommon object");
sleep(1);
delete sExampleBrowser;
sExampleBrowser = 0;
sleep(1);
sExampleBrowser = 0;
errx(EXIT_FAILURE, "aborted example on signal %d", signo);
} else
{
b3Printf("no action");
b3Printf("no action");
exit(EXIT_FAILURE);
}
interrupted = true;
warnx("caught signal %d", signo);