Gracefully handle signals in retroshare-android-service

This commit is contained in:
Gioacchino Mazzurco 2018-01-25 15:50:12 +01:00
parent 8c21bfcd54
commit ac9a8437fa

View File

@ -20,6 +20,7 @@
#include <QDebug>
#include <QDir>
#include <QTimer>
#include <csignal>
#ifdef __ANDROID__
# include "util/androiddebug.h"
@ -38,6 +39,13 @@ int main(int argc, char *argv[])
#endif
QCoreApplication app(argc, argv);
signal(SIGINT, &QCoreApplication::exit);
signal(SIGTERM, &QCoreApplication::exit);
#ifdef SIGBREAK
signal(SIGBREAK, &QCoreApplication::exit);
#endif // def SIGBREAK
ApiServer api;
RsControlModule ctrl_mod(argc, argv, api.getStateTokenServer(), &api, true);
api.addResourceHandler(