git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@281 620bd6b2-0a58-f614-fd9a-1bd335dccda9
This commit is contained in:
+10
-9
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user