mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Gracefully handle signals in retroshare-android-service
This commit is contained in:
parent
8c21bfcd54
commit
ac9a8437fa
@ -20,6 +20,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <csignal>
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
# include "util/androiddebug.h"
|
# include "util/androiddebug.h"
|
||||||
@ -38,6 +39,13 @@ int main(int argc, char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
QCoreApplication app(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
|
|
||||||
|
signal(SIGINT, &QCoreApplication::exit);
|
||||||
|
signal(SIGTERM, &QCoreApplication::exit);
|
||||||
|
#ifdef SIGBREAK
|
||||||
|
signal(SIGBREAK, &QCoreApplication::exit);
|
||||||
|
#endif // def SIGBREAK
|
||||||
|
|
||||||
ApiServer api;
|
ApiServer api;
|
||||||
RsControlModule ctrl_mod(argc, argv, api.getStateTokenServer(), &api, true);
|
RsControlModule ctrl_mod(argc, argv, api.getStateTokenServer(), &api, true);
|
||||||
api.addResourceHandler(
|
api.addResourceHandler(
|
||||||
|
Loading…
Reference in New Issue
Block a user