Guest User

Untitled

a guest
Feb 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1.  
  2. #include <csignal>
  3. #include <stdint.h>
  4. #include <QtGui/QApplication>
  5. #include "Core.h"
  6.  
  7. void exitQt(CCore* core_IO)
  8. {
  9.     qDebug("properly exit");
  10.     core_IO->clean();
  11.     QCoreApplication::exit(0);
  12. }
  13.  
  14.  
  15. int32_t main(int32_t argc, char *argv[])
  16. {
  17.     registerMyTypes();
  18.  
  19.     QApplication a(argc, argv);
  20.  
  21.     CCore core;
  22.  
  23.     signal(SIGINT, &exitQt(&core));
  24.     signal(SIGTERM, &exitQt(&core));
  25.     signal(SIGKILL, &exitQt(&core)) ;
  26.  
  27.  
  28.     return a.exec();
  29. }
Add Comment
Please, Sign In to add comment