mirror of
https://github.com/Qv2ray/Qv2ray.git
synced 2025-05-20 19:00:22 +08:00
prevent Windows users from being suffered from the SIGNALs
This commit is contained in:
parent
e9f51034e4
commit
cbd61cc5ff
@ -211,11 +211,13 @@ bool initialiseQv2ray()
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
// Register signal handlers.
|
// Register signal handlers.
|
||||||
signal(SIGINT, signalHandler);
|
signal(SIGINT, signalHandler);
|
||||||
signal(SIGHUP, signalHandler);
|
signal(SIGHUP, signalHandler);
|
||||||
signal(SIGKILL, signalHandler);
|
signal(SIGKILL, signalHandler);
|
||||||
signal(SIGTERM, signalHandler);
|
signal(SIGTERM, signalHandler);
|
||||||
|
#endif
|
||||||
//
|
//
|
||||||
// parse the command line before starting as a Qt application
|
// parse the command line before starting as a Qt application
|
||||||
{
|
{
|
||||||
@ -462,12 +464,14 @@ int main(int argc, char *argv[])
|
|||||||
QObject::connect(&_qApp, &QGuiApplication::commitDataRequest, []() {
|
QObject::connect(&_qApp, &QGuiApplication::commitDataRequest, []() {
|
||||||
LOG(MODULE_INIT, "Quit triggered by session manager.");
|
LOG(MODULE_INIT, "Quit triggered by session manager.");
|
||||||
});
|
});
|
||||||
|
#ifndef Q_OS_WIN
|
||||||
signal(SIGUSR1, [](int) {
|
signal(SIGUSR1, [](int) {
|
||||||
emit MainWindow::mwInstance->Connect();
|
emit MainWindow::mwInstance->Connect();
|
||||||
});
|
});
|
||||||
signal(SIGUSR2, [](int) {
|
signal(SIGUSR2, [](int) {
|
||||||
emit MainWindow::mwInstance->DisConnect();
|
emit MainWindow::mwInstance->DisConnect();
|
||||||
});
|
});
|
||||||
|
#endif
|
||||||
auto rcode = _qApp.exec();
|
auto rcode = _qApp.exec();
|
||||||
LOG(MODULE_INIT, "Quitting normally")
|
LOG(MODULE_INIT, "Quitting normally")
|
||||||
return rcode;
|
return rcode;
|
||||||
|
Loading…
Reference in New Issue
Block a user