git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@281 620bd6b2-0a58-f614-fd9a-1bd335dccda9

This commit is contained in:
matlabbe
2014-05-22 15:18:29 +00:00
parent 19b5776ba4
commit d2946cac3b
2 changed files with 11 additions and 10 deletions
+10 -9
View File
@@ -7,8 +7,7 @@
#include <signal.h>
void my_handler(int s){
printf("Ctrl-C caught! Quitting application...\n");
QApplication::closeAllWindows();
printf("\nCtrl-C caught! Quitting application...\n");
QApplication::quit();
}
@@ -133,13 +132,15 @@ int main(int argc, char* argv[])
mainWindow.startProcessing();
}
// Catch ctrl-c to close the gui
struct sigaction sigIntHandler;
sigIntHandler.sa_handler = my_handler;
sigemptyset(&sigIntHandler.sa_mask);
sigIntHandler.sa_flags = 0;
sigaction(SIGINT, &sigIntHandler, NULL);
if(!guiMode)
{
// Catch ctrl-c to close the gui
struct sigaction sigIntHandler;
sigIntHandler.sa_handler = my_handler;
sigemptyset(&sigIntHandler.sa_mask);
sigIntHandler.sa_flags = 0;
sigaction(SIGINT, &sigIntHandler, NULL);
}
return app.exec();
}